ASP.NET Show - Knowledge Base

« Back to Knowledge Base list

How to change the panel's URL in client-side.

Q:

I have the Show control with two panels.
Is there any way to programmatically change the URL of a panel in a Show from javascript?

A:

Here is the code sample:

<obshow:Show id="Show1" runat="server" …>

</obshow:Show>


var iframeID = "iframe_Show1_0"; // first panel
var iframeObject = document.getElementById(iframeID);
if (iframeObject) {
    iframeObject.src = " news_posts.aspx?startatpost=1";
}
 
iframeID = "iframe_Show1_1"; // second panel
iframeObject = document.getElementById(iframeID);
if (iframeObject) {
    iframeObject.src = " news_posts.aspx?startatpost=6";
}


"I reviewed your GridView control features and thought you guys did a great job with your control!!!"

Tatyana Hughes
Wayside Technology Group

Random testimonial   All testimonials