Web Forms :: Variable For Hyperlink Column Using Javascript?

Mar 22, 2010

I have a hyperlink column in a datagrid that uses DataNavigateUrlFormatString to open a popup window via javascript. I am trying to get two variables from a sql to show in the query string for the popup window. I am able to pass the sessionstart date which is ={0} but the other those two variables in the javascript I am not sure how to pass. The two are school_id and program_id in the select statement below:

strsql = "select count(z.iIndividualid) as enrolled,session_id,school_id as SchoolId,program_id as ProgramId,convert(nvarchar(10),session_start_date,101) as SessionStartDate, session_class_size as SessionClassSize from dbo.cnSchoolProgramSessions cn with
(nolock) left join customerproductdetail cpd on cn.session_start_date = cpd.dtdate1 left join customerproduct cp on cpd.iproductid=cp.iproductid and cp.iSiteId = cpd.iSiteId and cpd.tiRecordStatus = cp.tiRecordStatus left join individual z on z.iIndividualId
= cp.iOwnerId And z.tiRecordStatus = cp.tiRecordStatus where record_status = 1 and school_id = '" & iSchool & "' and program_id = '" & iProgram & "' group by session_id, school_id, program_id,session_start_date,session_class_size"

[Code]....

What do I need to pass in the hyperlink column to get the proper? Hopefully this makes sense to someone

View 1 Replies


Similar Messages:

Web Forms :: Sending Variable To Another Page Using Hyperlink?

Aug 27, 2010

<asp:hyperlinkfield
datatextfield="fldfsl"
datanavigateurlfields="fldfsl"
datanavigateurlformatstring="website1.aspx?para1=dtersaga"
/>

that works like predicted when i declare the variable for para1 but i need it to read the fldfsl and pull that and put it behind para1= like this (but does not work)

<asp:hyperlinkfield
datatextfield="fldfsl"
datanavigateurlfields="fldfsl"
datanavigateurlformatstring="website1.aspx?para1=fldfsl"
/>

View 2 Replies

Web Forms :: Passing Value Of A Variable With URL Of The Hyperlink Control?

Sep 4, 2010

I have 10 hyperlink controls. Depending on which hyperlink is pressed I want to pass a value to the target page. I think the easiest way would be to pass the value using URL of the hyperlink controls. Something like <asp:HyperLink ID="HyperLink1" NavigateUrl="~/News.aspx?id=>. I can pass just a value, but I want to pass a value from a variable.

<asp:HyperLink ID="HyperLink1" runat="server"

View 3 Replies

Forms Data Controls :: Pass Variable With Repeater Hyperlink URL

Jan 15, 2010

I query the database to get the VideoName and VideoURL of the videos held in my database (Videos saved on the file system with their location stored in the database) then bind the query results to a repeater with the following code

protected void Page_Load(object sender, EventArgs e)
{
// Variables declaration
string strConnString = ConfigurationManager.ConnectionStrings["vidConnectionString"].ConnectionString;
SqlConnection sqlConn = new SqlConnection(strConnString);
SqlCommand sqlcmd = new SqlCommand("SELECT [VideoName], [VideoURL] FROM [Video]");
SqlDataReader sqlReader;
sqlConn.Open();
sqlcmd.Connection = sqlConn;
sqlReader = sqlcmd.ExecuteReader();
VideoRepeater.DataSource = sqlReader;
VideoRepeater.DataBind();
sqlConn.Close();
}

and put a hyperlink into the repeater to list all the VideoName's this works fine but I want to pass the VideoURL to the next page I am using NavigateUrl="PlayVideo.aspx?VideoURL='<%# Eval("VideoURL") %>'" but when I try and load the Page I get the error saying The server tag is not well formed. the whole repeater code is

<asp:Repeater ID="VideoRepeater" runat="server" >
<ItemTemplate>
<asp:HyperLink ID="VideoLink" NavigateUrl="PlayVideo.aspx?VideoURL='<%# Eval("VideoURL") %>'" runat="server"><%# Eval("VideoName") %></asp:HyperLink>
</br>
</ItemTemplate>
</asp:Repeater>

I'm sure i've just got the hyperlink navigateURL wrong put not sure how else to pass the VideoURL variable

View 9 Replies

JQuery :: Grab A Global Variable Or Session Or View State Variable In The Javascript?

Dec 9, 2010

can we grab a global variable or Session or View State variable in the javascript or using jquery?

View 2 Replies

C# - Hidden Variable Vs Server Variable Accessing On Client Side In Javascript

Jul 14, 2010

I'm evaluating two options of accessing a server side data on client side. Little bit confused about the efficiency or may be you can call it as finding best approach to do it.

I need to access a server side data may be an integer value in javascript on client side. I know about two options to do it.Create a public variable or property on server side and set it to javascript variable on client side as below:

var value = eval(<% =value %>);

Create a asp hidden variable and set value in this hidden variable from server side and access it through javascript using document.getElementById().

Which is the best approach and what are the pros and cons?

View 1 Replies

Web Forms :: Hyperlink Column In Grid Is Not Formatting Properly?

Apr 12, 2010

In gridview I am adding row as mentioned below

string hyPerLinkUri = DispForm.aspx?ID=" + result["ID"].ToString()
row["Schedule ID"] = hyPerLinkUri;

Then I added hyperlinkfield column grid

[Code]....

It is showing hyperlink column link in grid properly, but as column text it is showing full hyperlink url rather then only value of ID, can anyone tell whats wrong I am doing here. Secondly, I also want that if someone click on hyperlink text, it should open in new window.

View 2 Replies

Web Forms :: HyperLink Column In A Gridview That Should Navigate To Another Page.

Nov 23, 2010

I have a HyperLink column in a gridview that when clicked should navigate the user to another page. I pass parameters to the page using a querystring. i want to know the basic code in C# to pass parameter to other using querystring

View 4 Replies

Forms Data Controls :: First Column Hyperlink But Not The Rest?

Mar 11, 2011

How do I do this for my gridview?

I tried this but gettiing variable 'h1' is used before it has been assigned a value. What am I doing wrong?

[Code]....

View 12 Replies

Forms Data Controls :: Hyperlink Column On The Fly In Datagrid?

Jan 15, 2010

Is there a way to make a hyperlink column in datagrid on the fly... I have a search page and would like the user to be able to click a button to few full contents about the item for editing, etc.

View 11 Replies

Forms Data Controls :: How To Remove Hyperlink When The Gridview Column Value Is 0

Mar 8, 2010

[code]....

BroughtForward and Pending both columns contain hyperlink values. When we click the values then another page opens with the details. I don't want to open another page if user click 0 in any column or in other words how to remove hyperlink if there is 0 in any cell?

View 16 Replies

Forms Data Controls :: Modify The Link Of A Hyperlink Column?

Aug 27, 2010

I'm a bit new to this game. I'm trying to build a web page that simply scans a directory in the server and creates a web page with links to the files in that directory - sounds simple and should be easy to do !So I have a bit of code that reads the myDocuments folder in my web site and then populates a grid view hyperlink column with the filenames in the folder - wow it works !The only thing I am struggling with now is getting the hyperlink correct within the GridView so that the user goes to the actual document.So my code behind is;

[Code]....

which reads the file info in the directory myDocuments and binds the info to a datasource.So now I'm using that datasource to display the filenames in a gridview so that the user can click on a name and open the file.

[Code]....

But of course the Name field in the hyperlink column is only the name of the file - how do I append the relative link to the filename to make the full path to the file correct.I tried to make the Hyperlink column a template field and do something like EVAL("~/path/"&"Name") but that doesn't work :(

[Code]....

View 3 Replies

Forms Data Controls :: Convert Column Into Hyperlink In Gridview?

Sep 5, 2010

how can i convert column in grid view into hyperlink

View 6 Replies

How To Include Session Variable In NavigateUrl In Hyperlink

Aug 3, 2010

I'm sure I've done this before, but can't remember the syntax. How do I include a session variable in nagivateUrl in a hyperlink?

I've tried this:

<asp:HyperLink ID="lnkMyLink" runat="server" Text="My Link"
NavigateUrl='<%# "http://absoluteURL.org?param=" +
Session["myParameterValue"].ToString()%>'></asp:HyperLink>

and this:

<asp:HyperLink ID="lnkMyLink" runat="server" Text="My Link"
NavigateUrl='<%# String.Format("http://absoluteURL.org?param={0}",
Session["myParameterValue"].ToString()) %>'></asp:HyperLink>

View 2 Replies

Forms Data Controls :: Can Conditionally Display Hyperlink In A Gridview Column

Jan 4, 2011

i have a gridview of a list of VehicleRequisition's with a column whose itemtemplate is as follows.

[Code]....

[Code]....

View 2 Replies

Forms Data Controls :: Transform Datatable To A Gridview With A Hyperlink Column?

Feb 10, 2011

I want to transfer data from datatable to a gridview with a hyperlink column. But dont know how to do.

I attach my code as below, what i want to do is to output 2 columns in gridview, and the first column should be a hyperlink. However, now the first column still shows nothing.

Web page code:

[Code]....

C# code:

[Code]....

View 6 Replies

Forms Data Controls :: How To Expose The Properties Of A Hyperlink Column In A Gridview

Jan 3, 2010

how can I expose the properties of a hyperlink column in a gridview so I can program then in vb code? For example I want to change the property of the DataNavigateUrlFormatString programatically using vb code? How can I do this?

View 5 Replies

Forms Data Controls :: Unable To Add And Bind HyperLink Column Ito WebService

Dec 8, 2010

I am having a DataGridView in that having 4 columns I need to bind 1 hyperlink column to the webservice which returns me DisplayText and Navigation URL.

View 1 Replies

Forms Data Controls :: Format GridView Column Head Hyperlink?

Jun 18, 2010

I have created a Gridview that has sorted columns. Using the HeaderStyle-CssClass ="GridViewHeader" The background = medium Blue and the Font Color = White. Looks cool, except for sorted columns. There the text is medium blue because it is a hyperlink. Is there any way to change the color for these hyperlinks?

View 1 Replies

Forms Data Controls :: Create A Hyperlink Column In Grid View?

Nov 8, 2010

How can i create a hyperlink to Grid view column, when i click this column it should open Word documentnt.Each Column row values does have seperate information.

View 3 Replies

Forms Data Controls :: ItemTemplate - Hide A Hyperlink Based On The Value Of A Column?

Apr 1, 2011

I have a gridview and in the gridview i have a an itemtemplatefield with a regular html hyperlink in it.

Based on the value of one of the columns in the gridview, i want to hide this hyperlink and just replace it with the value of another column

e.g. <a href="page.aspx?x=<%=Me.CurrentAgent.ID %>&id=<%# Eval("Id") %><%# Eval("Customer") %></a>

if Eval("Status") = 123 then instea of the above hyperlink, i just want <%# Eval("Customer") %>

View 2 Replies

Forms Data Controls :: Hyperlink To Files Or Webpage From Gridview Column?

May 25, 2010

We have a MS Access 2007 database that has a hyperlink column in one of the tables. I'm using Visual Studio 2008. I need to have the same column display in a gridview in ASP.net and have it function just like in access. In access, the user clicks the link and either the file or the wepage opens just fine. In the gridview in asp.net, if we click on the link it does "nothing". The links are to files on our network and to files on other people's websites and the paths are tested and work properly. The name of the column that holds the hyperlink is named MSDSLinke. Here is the code I am using:

<asp:TemplateField
HeaderText="MSDS"
SortExpression="MSDSLinke">

[code]...

View 11 Replies

Variable Inside Of The Markup For An Asp:HyperLink NavigationUrl Property?

Mar 9, 2010

I'm new to ASP.NET and can't figure out how to accomplish this...My code (that needs fixing):

<asp:HyperLink runat="server"
NavigateUrl="~/EditReport.aspx?featureId=<%= featureId %>" />

featureId gets defined as an integer in the backing code. I want href's like...

/EditReport.aspx?featureId=2224
...but instead I am getting...
/EditReport.aspx?featureId=<%= featureId %>

View 2 Replies

Forms Data Controls :: How To Change A Column From Hyperlink Field To Button In Gridview

Nov 12, 2010

How to change a column from hyperlink field to button in Gridview?

My current code is as follows

<asp:TemplateField HeaderText="Click">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%# Eval("ID", "Detail.aspx?ID={0}") %>'
Target="_blank" Text="Detail"></asp:HyperLink>
</ItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
</asp:TemplateField>

View 6 Replies

Forms Data Controls :: Persisting Color Of The Gridview Row On Click Of Hyperlink Column?

Mar 29, 2011

I have a requirement as mentioned below: 1. There is a gridview containing a linkbutton field (lnkgdvMerchant)in one of the column defination as menioned in the mark up below :Please note the bolded line of code for more details.

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved