|
Sonia Gupta wrote: Hi Guffa , Navaneeth,
Please don't address the question to specific member(s). This might prevent others replying to your pos. As Guffa said in his post, you can declare a variable inside a script and outside a function. This will be treated as public variable. See the example below
<script language='JavaScript'>
<!--
var Submitted = false;
function window_onbeforeunload(e) {
if (!Submitted) {
return(confirm("Are you sure to exit"));
}
}
</script> When any button is clicked, make this Submitted=true, which will avoid displaying the message.
Hope it helps
|
|
|
|
|
<body OnBeforeUnload = "window_onbeforeunload();">
this is the event on body tag , in besides to ur code.still occuring the message , on button click as well as on the form closing
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: on button click
Show me your button click JS code
|
|
|
|
|
friend , all i need to know that , how i should differentiate my form closing click fom the button control click , can i avoid these duplicate message, which is appearing on the button click and actually , it was supposed to emerge on the form close click.presently i am not writing any code on the button click.i just want to make the clarification , to avoid this problem.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: presently i am not writing any code on the button click
When you are writing make Submitted=true , which will stop the message from appearing. This value we are checking in the unload function, and message is displayed when this is false. So make it true, and message won't be displayed.
|
|
|
|
|
Wohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Thanks a Lot Friend
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Hi plz Refer this following Url[^]
They declared that headtab,subtab and its Url names in back end code...,
But,if i want to bind that name from my sqltable...,
how to do that...,
Plz Any one Give me some idea to solve this one...,
Advance Thanks,
Regards,
Magi
|
|
|
|
|
as per my requirement,i want to upload a file to the application server with out using the file upload control.
|
|
|
|
|
jagadeeshkumar1984 wrote: with out using the file upload control.
Strange , why do you want this without file upload control ? ASP.NET won't get permission to access any files from the client system. So there is no other way. In worst case you can write an activex control and do it, But I am not sure on this.
|
|
|
|
|
My scanner scan an image and saves it in a specified location in the client machine.
Now i want to upload this image.
I don't want to use the file upload control, 'cozi already know the location and the name of the image to be uploaded so i don't need to browse it.any other way????????
|
|
|
|
|
Write a windows application that opens this file and send it as binary to a webservice, which stores the file on server. ASP.NET can't do what you are expecting.
|
|
|
|
|
|
hello frnd how to find application path like(app.path in vb)
|
|
|
|
|
hi
Server.MapPath("~") returns root of the application
server.mappath("product.aspx") gives path for product page
-- modified at 1:45 Tuesday 30th October, 2007
Jintal Patel
|
|
|
|
|
Getting Vss error when tring to access the Vss DB from Apllication server throgh ASP
Error :-The SourceSafe database path does not exist
Mahammadhusen
|
|
|
|
|
Hi All,
I am adding conrols at runtime something like this:
//Label For Showing Symbol Text
Label lblSymbol = new Label();
lblSymbol.ID = "lblSymbol";
lblSymbol.Text = "Symbol";
lblSymbol.CssClass = "text";
tab1.Controls.Add(lblSymbol);
Panel PopupMenu = new Panel();
PopupMenu.ID = "newPanel";
//Div Tag
HtmlGenericControl watch = new HtmlGenericControl();
watch.Style.Value = "background-color:#FBFBFB ;border:1px solid Blue;width:40%";
StringBuilder strPOPUPCompanyMenu = new StringBuilder("");
strPOPUPCompanyMenu.Append("<table width='700px' border='1' cellpadding='0' cellspacing='0'>");
strPOPUPCompanyMenu.Append("<tr><td> </td><td class='text' width='500px' align='left'>Country</td>");
strPOPUPCompanyMenu.Append("<td align='left' width='250px'>");
//CascadingDropDown For Country
AjaxControlToolkit.CascadingDropDown CascadingDropDown10 = new AjaxControlToolkit.CascadingDropDown();
CascadingDropDown10.ID = "CascadingDropDown10";
CascadingDropDown10.TargetControlID = "ddlcountry";
CascadingDropDown10.Category = "Country";
CascadingDropDown10.PromptText = "Select a Country";
CascadingDropDown10.ServicePath = "AutoComplete_WatchList.asmx";
CascadingDropDown10.ServiceMethod = "GetCountry";
watch.Controls.Add(CascadingDropDown10);
//DropDownList For Country
DropDownList ddlcountry = new DropDownList();
ddlcountry.ID = "ddlcountry";
ddlcountry.CssClass = "text";
ddlcountry.Width = 250;
watch.Controls.Add(ddlcountry);
strPOPUPCompanyMenu.Append("</td><td> </td></tr>");
strPOPUPCompanyMenu.Append("<tr><td> </td><td align='left' class='text'>Sector</td><td> </td></tr></table>");
watch.InnerHtml = strPOPUPCompanyMenu.ToString();
//Add div Tag to Panel
PopupMenu.Controls.Add(watch);
//PopupControlExtender For Showing Company Panel
AjaxControlToolkit.PopupControlExtender PopupControlExtender14 = new AjaxControlToolkit.PopupControlExtender();
PopupControlExtender14.ID = "PopupControlExtender14";
PopupControlExtender14.TargetControlID = "lblSymbol";
PopupControlExtender14.PopupControlID = "newPanel";
tab1.Controls.Add(PopupControlExtender14);
tab1.Controls.Add(PopupMenu);
But I cant see the dropdownlist on by page. Can sone tell me where I have going wrong.
I have to popup panel on lblSymbol click, I can just see select country but cant see ddlcountry.
Please help me....
Thanks in advance...
|
|
|
|
|
Hey can you make a simple POC and create a div tag add drop down at run time i think the problem is you are adding two times
i think second one is overidding firt one
ASP.NET 2.0 wrote: watch.Controls.Add(ddlcountry);
ASP.NET 2.0 wrote: watch.InnerHtml = strPOPUPCompanyMenu.ToString();
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I am trying to debug a code(asp.et) which was developed in 1.1v . i have migratated this to 2.0v . But when i attach the process , it doesnt stop at the breaks point i have set
The process is attached with out any error
|
|
|
|
|
I am using dropdownlist. this dropdown list attach in database. and dropdownlist enter the runtime value. e.g
dropdownlist property: AutoPostBack= True
dropdownlist1.items.insert(0,new listitem("Add new","0");
when click the Add New Then fired a event. Write a Code
private void dropdownlist1_selectedIndexChange( )
{
if(dropdownlist1.selectedindex == 0)
{
responce.wirte("asdF");
}
}
But this event is not fired.
|
|
|
|
|
Gagan Deep Garg wrote: But this event is not fired.
Is your page posting back ? I don't think so, I guess your drop down list contains only one item.
|
|
|
|
|
One Item In Run Time.(Add New)
When Click The Add New Then Appear One TextBox. Enter The Value In TextBox And Save DataBase. Then DropDown List Display Two values.
One is Add New and Second is DataBase Value.
My problem is:
Not Fired Event.
|
|
|
|
|
Gagan Deep Garg wrote: dropdownlist1.items.insert(0,new listitem("Add new","0");
If your dropdownlist only has one item, it will always choose that item. This is different with Windows Forms' ComboBox, that requires you to select first even if the ComboBox only has one item, unless you made the default selected item is the only one item available.
If your dropdownlist has more than one item, any item selected will trigger PostBack (as long as AutoPostBack is set to true).
Eriawan
|
|
|
|
|
AutoPostBack property is True.
|
|
|
|
|
Yes, I know. What I'm trying to say is, you should define items in your dropdownlist at least two items, instead of just one. Otherwise, the web browser will always chose the only one item and there will be no SelectedIndexChanged event fired, since there's just only one item.
There is a historical reason for this. W3C HTML 3.2/4.0 compliant browser such as IE 4.x or above, Netscape 7 or above, Firefox 1.5/2.0 or above, and Opera 5.x or above will always treat dropdownlist to automatically select first item it found, unless it's defined by the dropdownlist. If the item is only one instead of many items, it will always select the only one item.
For example, in your code you only define one item. Therefore when the ASP.NET page is rendered on client web browser, the first item selected is always the only one item and there will be no SelectedIndexChanged fired.
This is the default behavior of web drop down list (or dropdownlist in ASP.NET), and there's nothing you can do to overcome this event not fired problem, since it's the default behavior. ASP.NET (even other server side Java Server Pages, Struts) itself relies on the default render behavior on web browsers.
best regards,
Eriawan ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Is it possible to modify the location tag in webconfig through code for a new role.
-- modified at 0:38 Tuesday 30th October, 2007
|
|
|
|