Click here to Skip to main content
15,914,111 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionOwn control with visual styles Pin
vocaris9-Aug-07 12:14
vocaris9-Aug-07 12:14 
Questionother fourms Pin
vocaris10-Aug-07 8:00
vocaris10-Aug-07 8:00 
AnswerRe: other fourms Pin
meofcourse14-Aug-07 6:32
meofcourse14-Aug-07 6:32 
QuestionWebclient Proxy server authentication failure when on alternate thread Pin
dman77779-Aug-07 8:42
dman77779-Aug-07 8:42 
QuestionNeed to Connect to UNIX server From Desktop Pin
OldDog5009-Aug-07 8:29
OldDog5009-Aug-07 8:29 
AnswerRe: Need to Connect to UNIX server From Desktop Pin
MidwestLimey13-Aug-07 7:44
professionalMidwestLimey13-Aug-07 7:44 
GeneralRe: Need to Connect to UNIX server From Desktop Pin
OldDog50017-Aug-07 3:51
OldDog50017-Aug-07 3:51 
QuestionProblem getting value Pin
TAK789-Aug-07 6:24
TAK789-Aug-07 6:24 
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: <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!

AnswerRe: Problem getting value Pin
Dave Kreskowiak9-Aug-07 7:55
mveDave Kreskowiak9-Aug-07 7:55 
GeneralRe: Problem getting value Pin
TAK789-Aug-07 7:58
TAK789-Aug-07 7:58 
GeneralRe: Problem getting value Pin
Dave Kreskowiak9-Aug-07 8:13
mveDave Kreskowiak9-Aug-07 8:13 
QuestionRip CD Pin
meofcourse9-Aug-07 5:22
meofcourse9-Aug-07 5:22 
AnswerRe: Rip CD Pin
Kschuler9-Aug-07 9:18
Kschuler9-Aug-07 9:18 
GeneralRe: Rip CD Pin
meofcourse9-Aug-07 9:47
meofcourse9-Aug-07 9:47 
AnswerRe: Rip CD Pin
meofcourse9-Aug-07 12:20
meofcourse9-Aug-07 12:20 
AnswerRe: Rip CD Pin
ianbacalla9-Aug-07 23:26
ianbacalla9-Aug-07 23:26 
GeneralRe: Rip CD Pin
meofcourse11-Aug-07 17:57
meofcourse11-Aug-07 17:57 
GeneralRe: Rip CD Pin
ianbacalla14-Aug-07 16:00
ianbacalla14-Aug-07 16:00 
GeneralRe: Rip CD Pin
meofcourse14-Aug-07 18:23
meofcourse14-Aug-07 18:23 
GeneralRe: Rip CD Pin
Dogu Tumerdem22-Jan-10 2:50
Dogu Tumerdem22-Jan-10 2:50 
AnswerRe: Rip CD Pin
meofcourse14-Aug-07 6:30
meofcourse14-Aug-07 6:30 
GeneralRe: Rip CD Pin
ianbacalla14-Aug-07 21:22
ianbacalla14-Aug-07 21:22 
GeneralRe: Rip CD Pin
meofcourse15-Aug-07 4:46
meofcourse15-Aug-07 4:46 
Questionstring array to Byte array....conversion problem Pin
Cory Kimble9-Aug-07 4:51
Cory Kimble9-Aug-07 4:51 
AnswerRe: string array to Byte array....conversion problem Pin
Luc Pattyn9-Aug-07 5:05
sitebuilderLuc Pattyn9-Aug-07 5:05 

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.