Hi dude,
Try like this..
<div id="divContainer" runat="server">
<asp:HyperLink ID="aa1" runat="server" Text="asp tag" NavigateUrl="<%# this.Discipline %>">
</asp:HyperLink>
<br />
<h1 class="SpecialtyHeader"><%=this.Discipline %>
<span class="SpecialtyHeader">EHR</span>
<%--<span class="SpecialtySubHeader">Electronic Health Record</span>--%>
</h1>
<br />
<a runat="server" id="a_Overview" class="ContentSideBar" style="vertical-align: middle;" href='<%# string.Format("/Products/Specialty.aspx?discipline={0}&content=Overview", this.Discipline) %>'>
<img runat="server" id="img_Overview" class="MenuIcons" src="/Images/Icons/Categoryblue.png" alt="Specialty" />
<span runat="server" id="span_Overview" class="MenuHeader">Specialty Overview</span>
<img runat="server" id="arrow_Overview" class="MenuArrow" alt="menuArrow" src="/Images/Icons/RightArrowwhite.png" />
</a>
<br />
<br />
<asp:HyperLink ID="HyperLink1" runat="server" Text="last tag" NavigateUrl='<%# string.Format("testinglink.aspx?query={0}", this.Discipline) %>'>
</asp:HyperLink>
</div>
public string Discipline
{
get;
set;
}
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack) { }
else
{
Discipline = "Cardiology";
divContainer.DataBind();
}
}
Note:
What you have to do is, u have to place all the controls in a container control
and after setting the desired property in cs file. you have to bind the container control by calling databind function
divContainer.DataBind();
you can check the code for formatting the url to frame the query strings