Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Cell with dynamic control


Cell with dynamic control

Reply
  #1 (permalink)  
Old 12-20-03, 06:52 AM
candykung candykung is offline
New Member
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Cell with dynamic control

Dear Specialist,

I create an online shopping using cells of the table with hyperlink. I make use of the example of Visual.net


Public Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
' Total number of rows
Dim rowCnt As Integer
' Current row count
Dim rowCtr As Integer
' Total number of cells (columns)
Dim cellCtr As Integer
' Current cell counter
Dim cellCnt As Integer

rowCnt = CInt(TextBox1.Text)
cellCnt = CInt(TextBox2.Text)

For rowCtr = 1 To rowCnt
Dim tRow As New TableRow()
For cellCtr = 1 To cellCnt
Dim tCell As New TableCell()
' Mock up a product ID
Dim prodID As String
prodID = rowCtr & "_" & cellCtr

' Create literal text as control
Dim s As New LiteralControl()
s.Text = "Buy: "
tCell.Controls.Add(s) ' Add to cell
' Create Hyperlink Web Server control and add to cell
Dim h As New HyperLink()
h.Text = rowCtr & ":" & cellCtr
h.NavigateUrl = "http://www.microsoft.com/net"
tCell.Controls.Add(h)
' Add cell to row
tRow.Cells.Add(tCell) ' Add new TableCell object to row
Next cellCtr
Table1.Rows.Add(tRow) ' Add new row to table
Next rowCtr
End Sub


The question is : How to transfer the product ID with the hyperlink
http://www.microsoft.com/net ??
when I click the hyperlink, and request the product ID parameter in another web. There is nothing inside the prodID. Please help me !
The above example only mention to mock to prodID. How to transfer to another web page. There is no parameter inside the http://www.microsoft.com/net

Candy
Reply With Quote
  #2 (permalink)  
Old 12-25-03, 12:17 AM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by candykung
Dear Specialist,

I create an online shopping using cells of the table with hyperlink. I make use of the example of Visual.net


Public Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
' Total number of rows
Dim rowCnt As Integer
' Current row count
Dim rowCtr As Integer
' Total number of cells (columns)
Dim cellCtr As Integer
' Current cell counter
Dim cellCnt As Integer

rowCnt = CInt(TextBox1.Text)
cellCnt = CInt(TextBox2.Text)

For rowCtr = 1 To rowCnt
Dim tRow As New TableRow()
For cellCtr = 1 To cellCnt
Dim tCell As New TableCell()
' Mock up a product ID
Dim prodID As String
prodID = rowCtr & "_" & cellCtr

' Create literal text as control
Dim s As New LiteralControl()
s.Text = "Buy: "
tCell.Controls.Add(s) ' Add to cell
' Create Hyperlink Web Server control and add to cell
Dim h As New HyperLink()
h.Text = rowCtr & ":" & cellCtr
h.NavigateUrl = "http://www.microsoft.com/net"
tCell.Controls.Add(h)
' Add cell to row
tRow.Cells.Add(tCell) ' Add new TableCell object to row
Next cellCtr
Table1.Rows.Add(tRow) ' Add new row to table
Next rowCtr
End Sub


The question is : How to transfer the product ID with the hyperlink
http://www.microsoft.com/net ??
when I click the hyperlink, and request the product ID parameter in another web. There is nothing inside the prodID. Please help me !
The above example only mention to mock to prodID. How to transfer to another web page. There is no parameter inside the http://www.microsoft.com/net

Candy
Code:
 h.NavigateUrl = "http://www.yahoo.com/whatever.aspx?prod=" & prodID.ToString()
Is that what you need?
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validator ctrl in table cell : Strange behaviour sunny_doncaster ASP.NET 6 07-31-08 09:43 AM
PlaceHolder Control kamlesh_nadar ASP.NET 6 10-12-06 07:26 AM
Help with Dynamic Form talon39 JavaScript 2 10-27-03 05:50 AM
PHP - script for dynamic daily text...HELP! fpardi PHP 3 10-13-03 03:02 AM
dynamic uploader (progress bar) [PL]Greg PHP 8 07-02-03 12:07 PM


All times are GMT -5. The time now is 02:36 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.