|
Hi,
if you want to register a client side script in your code you can use the Page.RegisterClientScriptBlock method in the server side code to register the script that may be built using a StringBuilder.
PS: if you want to add a client side function to a server side button you can use the code behind as the following:
btn.attributes.add("onclick", "you javascript function");
Regards,
Jamil
|
|
|
|
|
Hi,
Actually i have 3 hyperlinks on a page.on click of each link it redirects to the corresponding webpage...
my issue is on initial page load my css class is not getting applied where as when i navigate to different page and comeback to this page then css class is getting applied...
Please help me regarding the same
|
|
|
|
|
Hi,
your css include in the master page should be like the following:
<link rel="stylesheet" href="Includes/style.css" type="text/css" media="screen" />
Regards,
Jamil
|
|
|
|
|
thanks for ur reply...
but the issue im not applying css class for link im applying for the webpage for the corresponding link...ie when i click on the links respective webpages will be dispalyed and i have a panel in the first page
and for that css class is not getting applied...on initial load...
the thing i on click of the each link corresponding css class should be applied for the web page not for the link....
modified on Thursday, April 29, 2010 3:36 AM
|
|
|
|
|
how are you applying the css class on initial load?
can you post a sample code?
Regards,
Jamil
|
|
|
|
|
if you want to use the same CSS for all pages in your site,
then add it in your web.config file:
<system.web>
<pages theme="themes folder name">
so you wont have to refrence it in the webpages.
hope this helps you.
|
|
|
|
|
Hi,
I've made a menu manually by creating linkbuttons, each time i click on a button, i get the rest of the items in this way. the menu was created in a MASTERPAGE!
item 1 subitem11
item 2 subitem12
item 3 subitem13
item 4
and if i click on item 2 - what was before disappears and i get the subitems for item 2. and its working great.
anyway, when i click on any of the items, i change the color of this item, then i Response.Redirect it to the desired page. when i redirect it to the page it loses all of the proporties i have set to this specific linkbutton. Is there anyway i can save those proporties each time i redirect to another page?
here is the C# code i've made:
protected void LinkButton1_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.Red;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton5.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.sub1.Visible = true;
this.sub1.Text = "BIOGRAPHY";
this.sub2.Visible = true;
this.sub2.Text = "DISTINCTIONS";
this.sub3.Visible = true;
this.sub3.Text = "EXHIBITIONS";
this.sub4.Visible = true;
this.sub4.Text = "LECTURES";
this.sub5.Visible = false;
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.Red;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton5.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.sub1.Text = "IN PROGRESS";
this.sub2.Text = "SELECTED WORKS";
this.sub3.Text = "BY TYPE";
this.sub4.Text = "BY DATE";
this.sub1.Visible = true;
this.sub2.Visible = true;
this.sub3.Visible = true;
this.sub4.Visible = true;
this.sub5.Visible = true;
this.sub5.Text = "ALL WORKS";
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
}
protected void LinkButton3_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.Red;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton5.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.sub1.Text = "IN PROGRESS";
this.sub2.Text = "SELECTED WORK";
this.sub3.Text = "BY TYPE";
this.sub4.Text = "BY DATE";
this.sub5.Visible = true;
this.sub5.Text = "ALL WORKS";
this.sub5.Visible = false;
this.sub4.Visible = false;
this.sub3.Visible = false;
this.sub2.Visible = false;
this.sub1.Visible = false;
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
Response.Redirect("~/Publications.aspx");
}
protected void LinkButton4_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.Red;
this.LinkButton5.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.sub1.Text = "RECENT NEWS";
this.sub2.Text = "NEWS LETTER";
this.sub5.Visible = false;
this.sub4.Visible = false;
this.sub3.Visible = false;
this.sub2.Visible = true;
this.sub1.Visible = true;
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
}
protected void LinkButton5_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton5.ForeColor = System.Drawing.Color.Red;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.sub5.Visible = false;
this.sub4.Visible = false;
this.sub3.Visible = false;
this.sub2.Visible = false;
this.sub1.Visible = false;
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
Response.Redirect("~/contact.aspx");
}
protected void sub3_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.Red;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
if (sub3.Text == "BY TYPE")
{
this.sub3.ForeColor = System.Drawing.Color.Red;
this.asub1.Visible = true;
this.asub2.Visible = true;
this.asub3.Visible = true;
this.asub4.Visible = true;
this.asub5.Visible = true;
this.asub6.Visible = true;
this.asub1.Text = "RESIDENTIAL";
this.asub2.Text = "PUBLIC";
this.asub3.Text = "COMMERCIAL";
this.asub4.Text = "EDUCATIONAL";
this.asub5.Text = "INTERIOR DESIGN";
this.asub6.Text = "COMPETITIONS";
}
}
protected void sub1_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.Red;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
if (sub1.Text == "BIOGRAPHY") Response.Redirect("~/Biography.aspx");
if (sub1.Text == "IN PROGRESS") Response.Redirect("~/InProgress.aspx");
if (sub1.Text == "Recent News") Response.Redirect("~/RecentNews.aspx");
}
protected void sub2_Click(object sender, EventArgs e)
{
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.Red;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
if (sub2.Text == "DISTINCTIONS") Response.Redirect("~/DISTINCTIONS.aspx");
if (sub2.Text == "Selected Work") Response.Redirect("~/SelectedWork.aspx");
if (sub2.Text == "NEWS LETTER") Response.Redirect("~/NEWSLETTER.aspx");
}
protected void sub4_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.Red;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
}
protected void sub5_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.Red;
this.asub1.Visible = false;
this.asub2.Visible = false;
this.asub3.Visible = false;
this.asub4.Visible = false;
this.asub5.Visible = false;
this.asub6.Visible = false;
}
protected void asub1_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.ForeColor = System.Drawing.Color.Red;
this.asub2.ForeColor = System.Drawing.Color.DimGray;
this.asub3.ForeColor = System.Drawing.Color.DimGray;
this.asub4.ForeColor = System.Drawing.Color.DimGray;
this.asub5.ForeColor = System.Drawing.Color.DimGray;
this.asub6.ForeColor = System.Drawing.Color.DimGray;
}
protected void asub2_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.ForeColor = System.Drawing.Color.DimGray;
this.asub2.ForeColor = System.Drawing.Color.Red;
this.asub3.ForeColor = System.Drawing.Color.DimGray;
this.asub4.ForeColor = System.Drawing.Color.DimGray;
this.asub5.ForeColor = System.Drawing.Color.DimGray;
this.asub6.ForeColor = System.Drawing.Color.DimGray;
}
protected void asub3_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.ForeColor = System.Drawing.Color.DimGray;
this.asub2.ForeColor = System.Drawing.Color.DimGray;
this.asub3.ForeColor = System.Drawing.Color.Red;
this.asub4.ForeColor = System.Drawing.Color.DimGray;
this.asub5.ForeColor = System.Drawing.Color.DimGray;
this.asub6.ForeColor = System.Drawing.Color.DimGray;
}
protected void asub4_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.ForeColor = System.Drawing.Color.DimGray;
this.asub2.ForeColor = System.Drawing.Color.DimGray;
this.asub3.ForeColor = System.Drawing.Color.DimGray;
this.asub4.ForeColor = System.Drawing.Color.Red;
this.asub5.ForeColor = System.Drawing.Color.DimGray;
this.asub6.ForeColor = System.Drawing.Color.DimGray;
}
protected void asub5_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.ForeColor = System.Drawing.Color.DimGray;
this.asub2.ForeColor = System.Drawing.Color.DimGray;
this.asub3.ForeColor = System.Drawing.Color.DimGray;
this.asub4.ForeColor = System.Drawing.Color.DimGray;
this.asub5.ForeColor = System.Drawing.Color.Red;
this.asub6.ForeColor = System.Drawing.Color.DimGray;
}
protected void asub6_Click(object sender, EventArgs e)
{
this.LinkButton1.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton2.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton3.ForeColor = System.Drawing.Color.DimGray;
this.LinkButton4.ForeColor = System.Drawing.Color.DimGray;
this.sub1.ForeColor = System.Drawing.Color.DimGray;
this.sub2.ForeColor = System.Drawing.Color.DimGray;
this.sub3.ForeColor = System.Drawing.Color.DimGray;
this.sub4.ForeColor = System.Drawing.Color.DimGray;
this.sub5.ForeColor = System.Drawing.Color.DimGray;
this.asub1.ForeColor = System.Drawing.Color.DimGray;
this.asub2.ForeColor = System.Drawing.Color.DimGray;
this.asub3.ForeColor = System.Drawing.Color.DimGray;
this.asub4.ForeColor = System.Drawing.Color.DimGray;
this.asub5.ForeColor = System.Drawing.Color.DimGray;
this.asub6.ForeColor = System.Drawing.Color.Red;
}
protected void asub3_Click1(object sender, EventArgs e)
{
}
protected void asub4_Click1(object sender, EventArgs e)
{
}
protected void asub5_Click1(object sender, EventArgs e)
{
}
protected void asub6_Click1(object sender, EventArgs e)
{
}
-------------------------------------------------------------------------
this is my master code-behind page:
<table align="center" style="text-align: center">
<tr valign="top">
<td style="width: 78px; height: 4px; text-align: left" valign="top">
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/upperline.png" /></td>
</tr>
<tr>
<td style="width: 78px; height: 5px; text-align: left">
<table style="width: 881px; height: 68px; text-align: center">
<tr>
<td style="width: 335px; height: 117px; text-align: left">
<table valign="top">
<tr>
<td style="width: 3px; height: 100px" title="KOON STUDIO" valign="top">
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/webimgs/logo.jpg" OnClick="ImageButton1_Click" /></td>
<td style="width: 331px; height: 100px" valign="top">
<table style="width: 497px; height: 98px">
<tr>
<td style="width: 165px" valign="middle">
<asp:LinkButton ID="LinkButton1" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="LinkButton1_Click">STUDIO</asp:LinkButton></td>
<td style="width: 217px">
<asp:LinkButton ID="sub1" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="sub1_Click"></asp:LinkButton></td>
<td style="width: 227px">
<asp:LinkButton ID="asub1" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="asub1_Click"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 165px">
<asp:LinkButton ID="LinkButton2" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="LinkButton2_Click">PROJECTS</asp:LinkButton></td>
<td style="width: 217px">
<asp:LinkButton ID="sub2" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="sub2_Click"></asp:LinkButton></td>
<td style="width: 227px">
<asp:LinkButton ID="asub2" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="asub2_Click"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 165px; height: 19px">
<asp:LinkButton ID="LinkButton3" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="LinkButton3_Click">PUBLICATIONS</asp:LinkButton></td>
<td style="width: 217px; height: 19px">
<asp:LinkButton ID="sub3" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="sub3_Click"></asp:LinkButton></td>
<td style="width: 227px; height: 19px">
<asp:LinkButton ID="asub3" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="asub3_Click"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 165px">
<asp:LinkButton ID="LinkButton4" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="LinkButton4_Click">NEWS</asp:LinkButton></td>
<td style="width: 217px">
<asp:LinkButton ID="sub4" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="sub4_Click"></asp:LinkButton></td>
<td style="width: 227px">
<asp:LinkButton ID="asub4" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="asub4_Click"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 165px">
<asp:LinkButton ID="LinkButton5" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="LinkButton5_Click">CONTACT US</asp:LinkButton></td>
<td style="width: 217px">
<asp:LinkButton ID="sub5" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="sub5_Click"></asp:LinkButton></td>
<td style="width: 227px">
<asp:LinkButton ID="asub5" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="asub5_Click"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 165px; height: 21px">
</td>
<td style="width: 217px; height: 21px">
</td>
<td style="width: 227px; height: 21px">
<asp:LinkButton ID="asub6" runat="server" Font-Names="Century Gothic" Font-Size="10pt"
Font-Underline="False" ForeColor="#404040" OnClick="asub6_Click"></asp:LinkButton></td>
</tr>
</table>
</td>
</tr>
</table>
<asp:Image ID="Image2" runat="server" ImageUrl="~/images/upper2line.png" /></td>
</tr>
</table>
</td>
</tr>
</table>
I would appreciate any help ( SORRY FOR THE LONG CODE LOL)
|
|
|
|
|
Why Link button ? Why not ASP.NET Menu ?
Cheers !
Abhijit Jana | MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
ASP menu is more flexible than Link Buttons!
but if you want to use LinkButtons, set it's style of selected in the page load event
|
|
|
|
|
|
Yeah a menu control could be just great, the only problem i couldnt design it the way i need it to be
like this :
http://www.campobaeza.com/[^]
any ideas?
|
|
|
|
|
Hello,
I´m a ex-programmer turned manager.
We will start development on a new ASP.NET web application and I wonder what are the best options for implementing membership services nowadays. We want to be able to support other databases other than MS SQL and the application should be hosted "on the cloud" or "on premises" depending on customer whim. Also, it would be great to be able to authenticate against AD and LDAP.
Microsoft membership? WCF Authentication, Role and provider services? My own custom machinations? Your custom machinations.
I just want some input so I can understand what my software architect says.
Thank you.
Fabio
|
|
|
|
|
|
Hi,
My site is based on ASP.NET (C#) with sql server as the data source.
My Task:
Create a table based on the data source and when data is changed on the data source (sql server) update
the client table, but only update the cell with the data the was changed and not all the table – no page refresh.
Let’s say that checking for updates happens every 10 seconds.
There should be no data manipulation by the client such as insert/update/delete.
It’s something like a stock ticker that only updates data when it’s needed and only the data the was changed.
There’re lots of technologies out there: Ajax, Comet, jQuery, Linq etc.. and I’m getting lost with a task that shouldn’t be so complicated.
Comet requires a constant connection between the client & server and can be trouble when working with lots of clients.
What the right way to go?
Can you point me to a sample of such grid?
Thanks,
Assaf.
|
|
|
|
|
Given these requirements you will need to use Ajax to make an out of band call to retrieve the database info. From there JQuery will help, though it isn't necessary, with updating the DOM if necessary. That's it. There are plenty of examples on Using AJAX.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
can you please point me to an example that do this?
Thanks,
Assaf
|
|
|
|
|
How about here[^]?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
google id full of examples but most of them are much more complicated in terms of user/client events and lack the part of DB changes that are being fetched by the client.
i'll appreciate an example.
Thanks,
Assaf.
|
|
|
|
|
Google is not going to provide you with a ready made solutions, neither are we. You have to learn to think for yourself.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
stassaf wrote: and I’m getting lost with a task that shouldn’t be so complicated.
Before you start to learn how
to do the updates you need something
to update.Have you already done something
similar to this ?
1. Create aspx page
2. Add to it a GridView
3. Fill a dataset from sql query
4. Set the GridView data source to the
dataset and bind
After this you can add methods to
stassaf wrote: when data is changed on the data source (sql server) update
the client table, but only update the cell with the data the was changed and not all the table
You can use updatepanel or XmlHttpRequest Object
or even an iframe to get the new data from server
without a page refresh.
Once you have this data you can then compare it to
existing data to find changes then update only the
cells whose data has changed.
Do you have any working code now ? If not follow the
steps i have laid out asking for help as needed.
|
|
|
|
|
Use an ajax update panel (UpdatePanel1) triggering a Timer Tick (Timer1) function which contains the UpdatePanel1.Update(); and that's all
|
|
|
|
|
thanks for your reply.
i'm not new to asp.net. but it's my 1st steps in asp.net ajax.
updatepanel looks to me as the answer to my task, can you point me to an example?
Thanks,
Assaf.
|
|
|
|
|
i'm not new to asp.net. but it's my 1st steps in asp.net ajax.
i'll appreciate an example that use the updatepanel which looks to me as the answer to my task.
Thanks,
Assaf.
|
|
|
|
|
|
If you're using Visual Studio 2008 or Visual Web Developer 2008, you can see the tools for Ajax Extensions or if is 2005, look here[^]
then add the timer and an update panel like...
<asp:Timer ID="Tmr_Update" runat="server" ontick="Tmr_Update_Tick">
</asp:Timer>
<asp:UpdatePanel ID="UpdPnl_UpdateEvery_5Sec" runat="server" UpdateMode="Conditional">
< ContentTemplate>
your content here
< /ContentTemplate>
< Triggers>
<asp:AsyncPostBackTrigger ControlID="Tmr_Update" EventName="Tick" />
< /Triggers>
< /asp:UpdatePanel>
You add a trigger and that means that the content template of the update panel will update every Tick event for the Tmr_Update Control...
you can Add the interval of the update like
Tmr_Update.Interval = 5;
Ahh don't forget the scriptManager before the tag
<asp:ScriptManager ID="SM_Detail" runat="server">
< /asp:ScriptManager>
Good luck
|
|
|
|