c# - Placing a variable from my Code Behind inside Repeater Control for NavigateUrl -
Text after
This is my repeater
& Lt; / ASP: Hyperlink & gt; & Lt; Br / & gt; & Lt; / ItemTemplate & gt; & Lt; SeparatorTemplate & gt; & Lt; Hour / & gt; & Lt; / SeparatorTemplate & gt; & Lt; / ASP: Repeater & gt; This defines the data in the page load behind my code
'' Data Dim Conn Objects Data.SqlClient.SqlConnection Dim Com Data.SqlClient.SqlCommand Dim as as the reader Data.SqlClient.SqlDataReader Conn = new Data.SqlClient.SqlConnection as (ConfigurationManager.ConnectionStrings ( "ConnectionString"). ConnectionString) com = new Data.SqlClient.SqlCommand (_ ( "Company_ID, Name chosen by name from companyTable command "), Connecticut) String My_Variable as My_Variable =" ~ / createthumb.ashx gu = / images / Logo.bmp? " + "& Xmax = 75 & ymax = 75" 'Connection Conn.Open (Open)' command executed command reader = com. Exact reader () 'bind the reader to the reader ....................... blog reporter.datasource = Reader blog reporter.Datind ()' Close Reader Reader . Close () 'Close Connection Conn. I Close () is Now I a variable called My_Variable Can I get inside your variable My_Variable my repeater?
The way you can make your variable repeat:
< Code> & lt; A href = '& lt;% = string.format ("CompanyProfile.aspx? Id = {0}", My_Variable)%> '& Gt; & Lt;% # Eval ("name")%> & Lt; / A & gt; EDIT: EDIT: You are using static controls, which do not require server control, you can use HTML elements and responses to your global variable Can be used. Like: & lt; Img id = "image1" style = "height: 56px; width: 64px;" Src = '& lt;% = My_Variable% & gt;' / & Gt;
Comments
Post a Comment