By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,684 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,684 IT Pros & Developers. It's quick & easy.

Two Different User Control on Same ASPX Page

P: n/a
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

Jun 1 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
whats your error?
"Rushi" <ru*************@gmail.comwrote in message
news:11**********************@j4g2000prf.googlegro ups.com...
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

Jun 1 '07 #2

P: n/a
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.

Jun 1 '07 #3

P: n/a
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=javascriptHideOthersTab(); </
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

Jun 4 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.