Friday, January 31, 2014

Bind dataitem properties inside the method called in templatefield of DataGrid in asp.net

Bind dataitem properties inside the method called in templatefield of DataGrid in asp.net

<asp:DataGrid ID="overview_propertie" runat="server" AutoGenerateColumns="false"
                        CellPadding="0" CssClass="propertylist" GridLines="None" UseAccessibleHeader="true"
                        Width="100%" ShowHeader="False">
                        <AlternatingItemStyle CssClass="row1" />
                        <Columns>
                            <asp:BoundColumn DataField="Name" HeaderText="<%$ Resources:property%>" ItemStyle-CssClass="header">
                                <ItemStyle CssClass="header" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="Value" HeaderText="<%$ Resources:value%>" />
                            <asp:BoundColumn DataField="Description" HeaderText="Description" ReadOnly="true" />
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <table>
                                        <tr>
                                            <td>
                                                <%# GetPropertyFiles(DataBinder.Eval(Container.DataItem, "ItemId"), DataBinder.Eval(Container.DataItem, "PropertyTypeId"))%>
                                                <a class="AttachButton" href="javascript://" onclick="return AddItemPropertyFiles('<%#Eval("ItemId") %>','<%#Eval("PropertyTypeId") %>');">
                                                    Attach File</a>

                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                    </asp:DataGrid>

Wednesday, January 29, 2014

Issue "Unable to launch the IIS Express Web server"

Today I was figuring out the issue “Unable to launch the IIS Express Web server, Port is in use”
So, I was pushing hard to find the way how to manually assign the port to my VS Solution.
Here's the one:

Steps to manually assign the port to VS 2012 Solution:
1. Right Click on the Start-up executable Project that you are trying to run and select option properties. (See Screenshot 1 below)

 Screenshot 1


2. Now, You will the list of options in the left-panel menu. Select option 'Web'. (See Screenshot 2)




Screenshot 2

3. Here you will find the option 'Use Visual Studio Developement Server' under the Servers Section
4. Do Check it, select Specific Port and assign your own port number (say 8115 See Screenshot 2 above). Let the other options remain intact.
5. I hope you will able to run your project successfully.

Thanks
Amit Jain