Click here to Skip to main content
16,011,469 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionGo back Pin
Tarik Guney9-Aug-07 6:15
Tarik Guney9-Aug-07 6:15 
QuestionIf we have ASP.NET AJAX, why should we learn Ajax? Pin
ctlqt129-Aug-07 5:59
ctlqt129-Aug-07 5:59 
AnswerRe: If we have ASP.NET AJAX, why should we learn Ajax? Pin
jcdevnet9-Aug-07 6:44
jcdevnet9-Aug-07 6:44 
AnswerRe: If we have ASP.NET AJAX, why should we learn Ajax? Pin
Christian Graus9-Aug-07 15:48
protectorChristian Graus9-Aug-07 15:48 
AnswerRe: If we have ASP.NET AJAX, why should we learn Ajax? Pin
S A R I T H9-Aug-07 17:52
S A R I T H9-Aug-07 17:52 
QuestionBuilding a ASP.net that generate graph on webpage, using excel sheet as a data source Pin
sheva1019-Aug-07 5:09
sheva1019-Aug-07 5:09 
Questionweb entry Pin
vophu9-Aug-07 5:00
vophu9-Aug-07 5:00 
QuestionProblem accessing HtmlInputHidden Pin
TAK789-Aug-07 4:44
TAK789-Aug-07 4:44 
I'm trying to access the value of a HtmlInputHidden inside a datalist, but I get "Object reference not set to an instance of an object" as an error when I try to call the value.
Here is my code:

Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound
Select Case e.Item.ItemType

Case ListItemType.Item, ListItemType.AlternatingItem
'Dim row As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim TitleLink As HyperLink = CType(e.Item.FindControl("ProdTitleLink"), HyperLink)
Dim TextLink As HyperLink = CType(e.Item.FindControl("ProdTextLink"), HyperLink)
Dim prodID As HtmlInputHidden = CType(e.Item.FindControl("ProductID"), HtmlInputHidden)

TextLink.NavigateUrl = "productDetails.aspx?catID=" & Request.QueryString("catID") & "Id" & prodID.Value
TitleLink.NavigateUrl = "productDetails.aspx?catID=" & Request.QueryString("catID") & "Id" & prodID.Value

End Select
End Sub

Code of Datalist:

<asp:DataList ID="DataList1" runat="server">
<HeaderTemplate>
<div class="ProdHeadBox">
<div class="ProdTitleHead">Product</div>
<div class="ProdQtyHead">Qty</div>
<div class="ProdPriceHead">Price</div>
</div>
</HeaderTemplate>
<ItemTemplate>
<div class="ProdMainBox">
<div class="ProdPicBox">
<asp:Image ID="ProdImage" runat="server" ToolTip='<%# Eval("PictureLarge") %>' ImageUrl='<%# "~/images/productImages/small/" + DataBinder.Eval(Container.DataItem, "PictureSmall").ToString() %>' />
</div>
<div class="ProdTextBox">
<div class="ProdTitle">
<asp:HyperLink CssClass="ProdTitleLink" ID="HyperLink2" runat="server" NavigateUrl='<%# "productDetails.aspx?Id=" + Eval("ProductID").ToString() %>' ToolTip="Read More...">
<asp:Literal ID="litTitle" runat="server" Text='<%# Eval("ProductName") %>' /></asp:HyperLink>
</div>
<div class="ProdText">
<asp:Literal ID="ProdType" runat="server" Text='<%# Eval("Type") %>' /><br />
<asp:Literal ID="litDescription" runat="server" Text='<%# GetDescription(Eval("ProductDescription")) %>' /><br />
<asp:HyperLink CssClass="ProdTextLink" ID="HyperLink1" runat="server" NavigateUrl='<%# "productDetails.aspx?Id=" + Eval("ProductID").ToString() %>' ToolTip="Read More...">more...</asp:HyperLink>
<input type="hidden" id="ProductID" runat="server" value='<%# Eval("ProductID") %>' />
</div>

<div class="ProdQtyBox">
<asp:TextBox Width="25" ID="ProductQTY" Text="0" MaxLength="5" runat="server" />
<asp:RegularExpressionValidator ControlToValidate="ProductQTY" ValidationExpression="\d+" Text="*" ID="QTYValidator" runat="server"></asp:RegularExpressionValidator>
</div>
<div class="ProdAddBox">
Price:&nbsp;<asp:Literal ID="Literal1" runat="server" Text='<%# String.Format("{0:c}", Eval("ProductPrice")) %>' />
<br />
Per roll/pack<br />
<asp:Button ID="Add" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ProductID")%>' Text="Add" runat="server" />
</div>
</div>
</div>
</ItemTemplate>

</asp:DataList>

Thanks for any help!
QuestionSyantax for writing server side code in html. Pin
rahul.net119-Aug-07 3:12
rahul.net119-Aug-07 3:12 
AnswerRe: Syantax for writing server side code in html. Pin
George L. Jackson9-Aug-07 4:23
George L. Jackson9-Aug-07 4:23 
QuestionHow to get my local database intimated? Pin
Jagadeesh Jupalli9-Aug-07 2:38
Jagadeesh Jupalli9-Aug-07 2:38 
AnswerRe: How to get my local database intimated? Pin
Not Active9-Aug-07 3:17
mentorNot Active9-Aug-07 3:17 
GeneralRe: How to get my local database intimated? Pin
Jagadeesh Jupalli9-Aug-07 19:21
Jagadeesh Jupalli9-Aug-07 19:21 
GeneralRe: How to get my local database intimated? Pin
Not Active10-Aug-07 1:19
mentorNot Active10-Aug-07 1:19 
QuestionProblem with Access Pin
jaysheel9-Aug-07 2:34
jaysheel9-Aug-07 2:34 
AnswerRe: Problem with Access Pin
Nilesh Hapse9-Aug-07 2:37
Nilesh Hapse9-Aug-07 2:37 
GeneralRe: Problem with Access Pin
jaysheel9-Aug-07 7:18
jaysheel9-Aug-07 7:18 
AnswerRe: Problem with Access Pin
rahul.net119-Aug-07 3:17
rahul.net119-Aug-07 3:17 
QuestionCannot use a leading .. to exit above the top directory: Aspx error Pin
Blumen9-Aug-07 2:12
Blumen9-Aug-07 2:12 
AnswerRe: Cannot use a leading .. to exit above the top directory: Aspx error Pin
Nilesh Hapse9-Aug-07 2:47
Nilesh Hapse9-Aug-07 2:47 
GeneralRe: Cannot use a leading .. to exit above the top directory: Aspx error Pin
Blumen9-Aug-07 3:13
Blumen9-Aug-07 3:13 
AnswerRe: Cannot use a leading .. to exit above the top directory: Aspx error Pin
S A R I T H9-Aug-07 17:30
S A R I T H9-Aug-07 17:30 
QuestionASP.NET 2.0 and vista Pin
S A R I T H9-Aug-07 1:37
S A R I T H9-Aug-07 1:37 
AnswerRe: ASP.NET 2.0 and vista Pin
Christian Graus9-Aug-07 1:43
protectorChristian Graus9-Aug-07 1:43 
AnswerRe: ASP.NET 2.0 and vista Pin
Tarik Guney9-Aug-07 6:17
Tarik Guney9-Aug-07 6:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.