|
-
Jun 16th, 2005, 12:35 PM
#1
Thread Starter
Frenzied Member
How grap the passed value in URL ?
Hi guys i am passing a aspx page with teamno value( teamsandmatchs.aspx?team=2 ) I do not know how i can grap that passed value and place it inside html url. i want the passed value to be placed after teamno=.
Code:
p><a href="http://localhost/updatemachrecord/insertmatchviateam.aspx?teamno=">Add Record</a>
i be happy if some one show me how i put passed value team after ?teamno= in the url.Thanks
here is my page code
Code:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="teamsandmatches.aspx.vb" Inherits="updatemachrecord.teamsandmatches"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebFormTeams</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:DataGrid id="DataGridTeams" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 64px"
runat="server" Width="264px" Height="208px" BorderColor="White" BorderStyle="Ridge" CellSpacing="1"
BorderWidth="2px" BackColor="White" CellPadding="3" GridLines="None" PageSize="5" AllowPaging="True">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#9471DE"></SelectedItemStyle>
<ItemStyle ForeColor="Black" BackColor="#DEDFDE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="#E7E7FF" BackColor="#4A3C8C"></HeaderStyle>
<FooterStyle ForeColor="Black" BackColor="#C6C3C6"></FooterStyle>
<Columns>
<asp:ButtonColumn Text="Delete" CommandName="Delete"></asp:ButtonColumn>
<asp:HyperLinkColumn Text="Edit" DataNavigateUrlField="MATCHNO" DataNavigateUrlFormatString="http://localhost/updatemachrecord/matchupdateteams.aspx?match={0}"></asp:HyperLinkColumn>
</Columns>
<PagerStyle HorizontalAlign="Right" ForeColor="Black" BackColor="#C6C3C6" Mode="NumericPages"></PagerStyle>
</asp:DataGrid>
</form>
<p><a href="http://localhost/updatemachrecord/insertmatchviateam.aspx">Add Record</a>
<asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 168px; POSITION: absolute; TOP: 16px" runat="server"
Height="32px" Width="184px">Matches Record by teams</asp:Label></p>
</body>
</HTML>
-
Jun 16th, 2005, 11:07 PM
#2
Member
Re: How grap the passed value in URL ?
In codebehind the value can be retreived from the request object
Code:
Request.QueryString["team"]
To be able to do this on the client ride reffer to this article
Click Here
Nikhil Aggarwal

-
Jun 17th, 2005, 12:46 AM
#3
Re: How grap the passed value in URL ?
No need to post multiple times, tony.
-
Jun 17th, 2005, 02:20 AM
#4
Thread Starter
Frenzied Member
Re: How grap the passed value in URL ?
 Originally Posted by Nikhil Aggarwal
In codebehind the value can be retreived from the request object
Code:
Request.QueryString["team"]
To be able to do this on the client ride reffer to this article
Click Here

Thank u for u reply. do u mean should do like this
Code:
Request.QueryString["team"]
p><a href="http://localhost/updatemachrecord/insertmatchviateam.aspx?teamno=Request.QueryString["team"]">Add Record</a>
-
Jun 20th, 2005, 12:24 AM
#5
Member
Re: How grap the passed value in URL ?
 Originally Posted by tony007
Code:
p><a href="http://localhost/updatemachrecord/insertmatchviateam.aspx?teamno=Request.QueryString["team"]">Add Record</a>
I'm presuming you are tring to generate a hyperlink based on a parameter that the page recieves in its querystring.
Request.QueryString["team"] would work only in the code behind, so you would need to generate the hyperlink in the code behind itself.
Eg:
Code:
<asp:HyperLink id="HyperLink1" runat="server">Add Record</asp:HyperLink>
VB Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If (Not IsPostBack) Then
Dim linkurl As New System.Text.StringBuilder
linkurl.Append("http://localhost/updatemachrecord/insertmatchviateam.aspx?teamno=")
linkurl.Append(Request.QueryString("teamno").ToString())
HyperLink1.NavigateUrl = linkurl.ToString()
End If
End Sub
Nikhil Aggarwal

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|