Two Different User Control on Same ASPX Page

R

Rushi

Hi All,

I have created two different User Control. This two UCs have their own
Javascript code to do some stuff.

Now both UCs are mutualy exclusive like when one is visible I have to
hide second one.

This is working fine if I am not adding that ClicntSide Script, but
when I am inserting client side scripts, it started giving me error.

As ClientSide script is gettign Add, but as user control is not
visible and hence its child control is not available and so that
Script is not able to search that control.

Can anyone has idea how do I resolve the problem?

Regards
Rushikesh
 
T

tomisarobot

wrap them in a <div style="display:none;"></div>

they will still exist insofar as asp and javascript are concerned, so
take that into consideration for any assumptions about state testing.
 
R

Rushi

Actually I am using two differnt UserControl in one UpdaePanel.

Now both Usercontrol are mutualy exclusive...

As Atalas is not doing any postback so I cant use code like

myUserControl.visible = true;

Now, I put this UC in a Div...And trying to hide this DIV using some
Javascript.

startupScript = "<script language=javascript> HideOthersTab(); </
script>"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "Startup",
startupScript)


My javascript function is looks like.....

function HideOthersTab()
{
//var targetEleID;
//targetEleID.options[2].selected=true;

document.getElementById('<%= DivforMeetingResult.ClientID
%>').style.display = "block";
document.getElementById('<%= DivforMeetingResult.ClientID
%>').style.overflow = "auto";
}


Now this code is working fine....but When it sends an Ajax request,
its hiding the other UserControl for little period and then it again
showing me the both UC.

I tried lot to resolve this error....

Can any one help me?

Thankyou in Advance....

Rushikesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top