|
Thanks for the reply Navaneeth.
My problem is that I have Ajax TabContainer on my User Control Form and all the TabPanel are generated at runtime and so depending upon the tab selection I have to display some data from database. OnClientActiveTabChanged Event I capture which tab is selected and accordingly display that data.
But in javascript I save the selected tab value in the hidden textbox but when I say wind.location.reload my textbox value is blank.
Can u please tell me what might be the problem or is there any other way I can do the same task..
Thanks again...
|
|
|
|
|
ASP.NET 2.0 wrote: Can u please tell me what might be the problem or is there any other way I can do the same task..
We've both given you accurate answers, I'm not really sure what else to say.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sir my project understand only usercontrol forms they dont understand aspx or html pages.
So I need some solution to handle this...
I hope u understood my problem..
Thanks...
|
|
|
|
|
ASP.NET 2.0 wrote: my project understand only usercontrol forms they dont understand aspx or html pages.
What this means ? I am not getting what you are trying to do. Can you please provide more information on this ? What happened after you tried my suggestion ? Was that working ?
|
|
|
|
|
Sir I am using Dot Net Nuke code where I tried using your suggestion before only but its not working.
So I thought of make use of Javascript to get the value of tab selected index and depending on that display the data.
Any suggestions???
|
|
|
|
|
ASP.NET 2.0 wrote: Dot Net Nuke code
oops, sorry I don't have any idea on dot net nuke
|
|
|
|
|
Did you check that the ClientState of the TabContainer isn't holding the selected Tab already? Just guessing though.
(Assuming you use the ASP.NET 2.0 AJAX 1.0 Control Toolkit TabControl)
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Thanks for the reply. Here is the javascript code:
function ActiveTabChanged(sender, e)
{
var mytool_array=sender.get_activeTab().get_id().split("_");
document.getElementById("<%=htxtQueryStringValues.ClientID%>").value = "fromtab=true&tab=" +mytool_array[4] +"&sheet=" +sender.get_activeTab().get_headerText() ;
document.getElementById('txtQueryString').value = "fromtab=true&tab=" +mytool_array[4] +"&sheet=" +sender.get_activeTab().get_headerText() ;
alert(document.getElementById("<%=htxtQueryStringValues.ClientID%>").value);
window.location.reload();
}
And on page load I am checking the value but I am not getting the value of hidden textbox.
Please help me...
|
|
|
|
|
You can check the ActiveTab property of your AjaxControlToolkit.TabContainer during the postback to get access to the current tab.
And ActiveTab.HeaderText to access the heading of it.
Have a look at the sample web site that is included in the ajax toolkit download.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
I suppose u didnt undertsood my problem. Here is the code of Page load:
AjaxControlToolkit.TabPanel tab0 = new AjaxControlToolkit.TabPanel();
tab0.ID = "0";
tab0.HeaderText = "Summary";
tab0.Attributes.Add("onclick", "myfunc(" + tab0.ID + ");");
Label lblcompany = new Label();
lblcompany.Text = Session["CompanyName"].ToString();
tab0.Controls.Add(lblcompany);
TabSheet.Tabs.Add(tab0);
AjaxControlToolkit.TabPanel tab11 = new AjaxControlToolkit.TabPanel();
tab11.ID = "11";
tab11.HeaderText = "Ratio";
tab11.Attributes.Add("onclick", "myfunc(" + tab11.ID + ");");
Label lblcompany11 = new Label();
lblcompany11.Text = Session["CompanyName"].ToString();
tab11.Controls.Add(lblcompany11);
TabSheet.Tabs.Add(tab11);
string strqry = My Query through which I get the Tab Name from Database";
DataSet ds = new DataSet();
switch (Convert.ToInt16(Session["Country"]))
{
case 1:
ds = cs.Return_Dataset(strqry, cs.connectionUS());
break;
case 2:
ds = cs.Return_Dataset(strqry, cs.connectionUK());
break;
case 3:
ds = cs.Return_Dataset(strqry, cs.connectionJP());
break;
default:
ds = cs.Return_Dataset(strqry, cs.connectionUS());
break;
}
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
AjaxControlToolkit.TabPanel tab1 = new AjaxControlToolkit.TabPanel();
tab1.Height = 5;
tab1.ID = Convert.ToString(ds.Tables[0].Rows[i]["subformid"]);//(dt.Rows[i]["subformid"]);
tab1.HeaderText = (string)(ds.Tables[0].Rows[i]["sheetname"]);//dt.Rows[i]["sheetname"];
tab1.Attributes.Add("onclick", "myfunc(" + tab1.ID + ");");
Label lblcompany1 = new Label();
lblcompany1.Text = Session["CompanyName"].ToString() + " (all numbers are in thousands) ";
Label lblsc = new Label();
if (str != "")
{
lblsc.Text = " " + " Scenario: " + str;
}
tab1.Controls.Add(lblcompany1);
tab1.Controls.Add(lblsc);
TabSheet.Tabs.Add(tab1);
}
TabSheet.ActiveTabIndex = 0;
apsx file has:
<ajaxToolkit:TabContainer runat="server" ID="TabSheet" OnClientActiveTabChanged="ActiveTabChanged">
</ajaxToolkit:TabContainer>
And Javascript Function:
function ActiveTabChanged(sender, e)
{
var mytool_array=sender.get_activeTab().get_id().split("_");
document.getElementById("<%=htxtQueryStringValues.ClientID%>").value = "fromtab=true&tab=" +mytool_array[4] +"&sheet=" +sender.get_activeTab().get_headerText() ;
alert(document.getElementById("<%=htxtQueryStringValues.ClientID%>").value);
window.location.reload();
}
Now tell me how do I do???
|
|
|
|
|
You can't use a hidden field together with reload (as posted in another post).
Therefore I suggested that you use the ActiveTab property on the server-side for whatever you want to do.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Can u please tell me how to do that as I couldnt find ActiveTab... Please help me...
|
|
|
|
|
Couldn't find? Come on
In your code TabSheet seams to be your TabContainer. Therefore: TabSheet.ActiveTab
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Ya I got that but not getting where to place as its giving error...
|
|
|
|
|
Hello Everyone,
I have one asp.net application in which I am embedding yahoo map to show the specified address using geocoding. but when I try to run, it gives me an JavaScript Error - 'YMap' is undefined.
Does anybody knows about it?
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
Yahoo has maps ? I'd have thought google maps would be more well known and better documented.
Obviously your script is broken, or you're testing on a PC that can't connect to the yahoo site. Try yahoo, their docs are what you obviously need.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Sonia Gupta wrote: http://www.codeproject.com/script/comments/forums.asp?msg=2260810&forumid=1725#xx2260810xx[^]
Advertising your post on other forums and trying to get reply. Brilliant But this won't really helps you, because it's rude.
|
|
|
|
|
ok sorry Navaneeth....PLease help
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
this is small side of the problem. if you put this code in code behind of asp.net page
protected void Page_Load(object sender, EventArgs e)
{
Image1.ImageUrl = Server.MapPath(@"images/1.jpg");
Image1.DataBind();
}
it will work in microsoft internet explorer,but not in opera and firefox???
any body can help???
|
|
|
|
|
When you run in IE, View the page source of IE see the path of that image.
and then as per that path you need to set in code like.
./images/1.jpg like that.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hi Experts,
Can someone tell why does the button width increases while i am trying to run the web application in another pc ? Your sugestions will help me a lot.
Thanks
CSS.
Sekhar
|
|
|
|
|
Because you didn't set a width and so the browser is free to choose one ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi
i am using two dropdownlist boxes in my application.the values of one box are append directly from data base in my application.on change of first drop down list i display the vaues of second drop down by using ajax,here for second drop down values are in another page i opened that in ajax,
but here problem is the value of second dropdown is not displayed at page load.plz solve the problem asap.
regards
venkat
|
|
|
|
|
You're writing your own ajax ? You're opening another page that has the second dropdown ? How are you trying to set the selected value in this page, via the URL ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|