|
thank u mr.AlexeiXX3 when iam taking ur example it is working fine..but the same i did in my project
but it is not firing the javascript ...any problem ..?
|
|
|
|
|
use onchange event for dropdownlist..
For Example..
function Test()
{
alert(document.getElementById('ddlId').value);
}
<asp:dropdownlist id="ddlId" onchange="Test();" runat="server">
|
|
|
|
|
Dear all,
I want to refresh data of GridView which on Web User Control (this Web User Control is in another Web User Control) after user closes pop up which is used to modify or add new data.
I use the following code but it does not works :
Response.Write("self.close(); opener.focus(); opener.location.href =\"javascript:__doPostBack('ctl00_testContentPlaceHolder_testContentUsrCtrl_LeftMessageUsrCtrl_btnRefresh','');\"");
If user click btnRefresh, it works fine.
Please tell me how I can do this.
Thanks in advance.
|
|
|
|
|
Hi,
I have a problem passing the value from parent to child. Can you please help? Thank you. My code:
protected void Message_To_Play_CheckedChanged(object sender, System.EventArgs e)
{
SqlConnection myConnection2;
myConnection2 = new SqlConnection("Data Source=oks\\sqlexpress;Initial Catalog=didb;User ID=sa;Password=AD");
SqlDataReader rdr = null;
try
{
myConnection2.Open();
SqlCommand myCommand2 = new SqlCommand ("SELECT TOP (1) RecNum FROM OUTDIAL_CAMPAIGN ORDER BY RecNum DESC", myConnection2);
rdr = myCommand2.ExecuteReader();
while (rdr.Read())
{
//HttpContext.Current.Response.Write("Your Record Number: " + rdr[0] + "");
// It write on the same page
HttpContext.Current.Response.Write("window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "'dependent=yes, resizable=yes, width=300, height=100');");
}
}
finally
{
// close the reader
if (rdr != null)
{
rdr.Close();
}
// Close the connection
if (myConnection2 != null)
{
myConnection2.Close();
}
}
// Done Querying the table to get the highest recnum.
}
|
|
|
|
|
R u getting any Error? I think u have Syntax error in this line
HttpContext.Current.Response.Write("<script language="JavaScript">window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "'dependent=yes, resizable=yes, width=300, height=100');</script>");
Try this,
HttpContext.Current.Response.Write("<script language='JavaScript'>window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "','Test','dependent=yes,resizable=yes, width=300, height=100');</script>");
|
|
|
|
|
I got an error:
CS0103: The name 'Server' does not exist in the current context
HttpContext.Current.Response.Write("window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "'PopUpMessage','dependent=yes, resizable=yes, width=300, height=150');");
|
|
|
|
|
Try this
HttpContext.Current.Response.Write("<script language='JavaScript'>window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "','PopUpMessage','dependent=yes, resizable=yes, width=300, height=150');</script>");
|
|
|
|
|
It gives me this error:
Compiler Error Message: CS0103: The name 'Server' does not exist in the current context
HttpContext.Current.Response.Write("window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "'Show Message','dependent=yes, resizable=yes, width=300, height=150');");
|
|
|
|
|
Hi,
I'm developing a treeview control in which by default if i click on all the parent nodes they are getting expanded. but my requirement is if i click on any of the parent node the remaining nodes are to be collapsed.
Is there any property in the design time to accomplish this, please let me know what is the best way to do this.
thanks,
Mohan
M.MohanVamsi
|
|
|
|
|
hi,
i'd like to access to a menu control in my master page so i wrote the following code in the page that uses master page but it returns error
protected void Page_Load(object sender, EventArgs e)
{
Menu MenuCat = this.Form.Parent.FindControl("MenuCat");
...
Error message:
Error 434 Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.Menu'. An explicit conversion exists (are you missing a cast?)
anyone knows what should i do?
|
|
|
|
|
i found it!!
i guess i should use this code:
protected void Page_Load(object sender, EventArgs e)
{
Menu MenuCat = (Menu)this.Form.Parent.FindControl("MenuCat");
Menu MenuSort = (Menu)this.Form.Parent.FindControl("MenuSort");
Menu MenuTypes = (Menu)this.Form.Parent.FindControl("MenuTypes");
Menu MenuLanguage = (Menu)this.Form.Parent.FindControl("MenuLanguage");
|
|
|
|
|
That works, but what I would do, is write a base page for all my pages, and in that base page, put a property that returns a strongly typed instance of my specific master page, as opposed to the Master property which returns the common base class.
At a minimum, I would store the names of those Menu controls as a resource, so you don't have to remember them and cannot mistype them, and I would check if FindControl returned null, so your site doesn't blow up if one of them is renamed or something.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how to use ajax in asp.net 2.0
Signature preview salil_k_singh 11:06 15 Jul '07
|
|
|
|
|
Which control of AJAX you want to use?
I Love T-SQL
|
|
|
|
|
Depends what you mean. AJAX itself is just javascript. That's all it is, you don't need any special library or download, you can write AJAX code with notepad.
Given the tone of your question ( which indicates you're not willing to do any research on your own ), I assume you don't want to use AJAX at all, but just drag and drop some controls onto a form and have them do AJAX for you. In that case, you need to download the ASP.NET AJAX library, install it, and read the docs.
I recommend reading the article I link to in my sig for a start.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i'm sorry to repeat the question
the first question is :
hi,,
on my project asp.net with c#
I added a javascript item for eg,, name : JS.js
and made the next function :
function PopUpQtyWindow(id)
{
window.open("productqty.aspx?id=" + id, "Cart", "status = 1, height = 150, width = 200, resizable = 0");
}
then on any page i tried to call this function as next :
int prodID = 1 ;
HyperTest.NavigateUrl = "javascript:PopUpQtyWindow(" + prodID + ");";
when running project and press the hyperTest .. Internet status bar message " Error on page " .
the thing that make that the same code on a solution is work as good and another one doesn't work ..
remark ,, i copy the code as it from the source one to another.
if any one from our friends can aid my i will give him
jooooo
|
|
|
|
|
Yeah, you did ask this before. Did you respond to the answers you got ? Did you check the details of the error in the manner that I explained to you ? Did you try firefox/firebug to help you work out the problem ? Or did you just find nothing you could cut and paste to solve the issue, and so just posted it again ?
We can't help. We don't know what the error is. We've explained to you how to work that out, once you do, and can post with more info, then we can help more.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
my friend ,,
take me easy
i swear i spent a day to try to solve it ,,
i download firebug ,,
the code is working with me on a project ,,
i copy it for another ,, without any result ,,,
the error is only that the status bar told me that error on page..
and what making me confused that the code is correct , and is working with another project ,,,,
i copy it and the java.js file and every thing is ok ,,
I know that this problem is obscure ,,
thanks for you my friend and also it's for you
jooooo
|
|
|
|
|
kindman_nb wrote: i download firebug ,,
But, did you use it ?
kindman_nb wrote: the error is only that the status bar told me that error on page..
If you click on the status bar, you should get a popup with more details. If you set your browser to how all errors, it will give you a popup right away. Any web dev should have this set.
But, if you actually USED firebug and set a breakpoint, you could check if your function was there, if it's being called, what line the error occurs on, etc.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How did you reference the javascript file??
Maybe you could post your code
Please dont paste too much code, just make a little example of a page with your hyperlink calling the js function
I had a problem similar, and the problem was the way i referenced the javascriptfile
Is the directories herarchy the same?? (Relative to the javascript file)
Alexei Rodriguez
|
|
|
|
|
really thanks my friend for your reply ..
I'm new on aps ,,,
AlexeiXX3 wrote: the problem was the way i referenced the javascriptfile
how can i do that ..
jooooo
|
|
|
|
|
|
You might run into problems again when you reference to masterpage from subdirectories
To avoid that, reference the js file in your masterpage as follows:
(Inside Body Tags)
<script src="<%= Me.ResolveURL("filename.js") %>" type="text/javascript"></script>
Alexei Rodriguez
|
|
|
|
|
ASP.Net seems to keep an eye out for some client side changes such as checkboxes, while completely ignoring other stuff. Losing Style.visibity information during postbacks really hurts for example.
Is there a way to make asp remember such changes, or to check them during postback, and set them myself?
|
|
|
|
|
If viewstate is turned on for a control, then changes are remembered. Any non server controls, are not remembered at all.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|