|
If you don't want to close the window just direct the user to another page, this would make the app much better for the user.
These days with tabbed browsing you could ask the user to close and it close the whole window, therefore annoying the user
|
|
|
|
|
hai Friend.
Please add window.opener='x' code before window.close
<script language="jscript" type="text/javascript">
function startTimer1(h,m,s)
{
var today=new Date();
if(h=="0" && m=="0" && s=="0")
{
h=00;
m=01;
s=00;
}
else
{
if(s=="00")
{
s=59;
if(m=="00" && h!="00")
{
h=parseInt(h)-1;
m=59;
}
else if(m!="00" && h=="00")
{
m=parseInt(m)-1;
}
else if(m!="00" && h!="00")
{
m=parseInt(m)-1;
}
else if(s=="00" && m=="00")
{
if(h!="00")
h=parseInt(h)-1;
}
}
else
s=parseInt(s)-1;
}
// add a zero in front of numbers<10
h=checkTime(h);
m=checkTime(m);
s=checkTime(s);
var timerText=h+":"+m+":"+s;
document.getElementById("<%=txtTimerId.ClientID%>").innerText=timerText;
if(timerText =="00:00:00")
{
alert("Your time is Over,Now the Application is going to close");
/// This is the Code I added here;
window.opener='x';
window.close();
return true;
}
t=setTimeout('startTimer1('+h+','+m+','+s+')',1000);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
</script>
|
|
|
|
|
a window can be closed using javascript if and only if it has been opened by javascript i.e. POPUP windows
Ashish Sehajpal
|
|
|
|
|
kindly, tell me how to handle Data Purging of previous month... I want the data of current month only...
|
|
|
|
|
Gee, if your question made sense, that would help.
Purging from where ? Why not just write your SQL, if it's a database, to return only for this month ?
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 )
|
|
|
|
|
We have a webservice ,and the web method has to take different arguments from xml files,and creates cache files as results.
For this I want to create a batch process so that web service has to run for all the possible conditions ,and it should save the resultant file in a cache folder.
Can anyone suggest a way to do this
|
|
|
|
|
I have developed an app that contains a web browser, i now wish to convert it to an aspx page. The problem i am having is i cannot call functions on the web page.
In my app i use:
browser.Document.InvokeScript(scriptName, parameters)
where script name is a string containing the name of the function and parameters is an array containing the variables i wish to pass into the function.
could someone please suggest how i may achieve the same result using C# code behind to call a javascript function?
I am not calling the function from a direct user response, so cant use onclick etc
Thanks for any advice you may be able to offer
|
|
|
|
|
You inject the method call into the script being generated. Obviously, your javascript does not exist until the code behind has run, so, you add javascript that calls the function when the page is loaded by the browser.
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 )
|
|
|
|
|
Hi all.
I want to use google analytics on a website which has an asp.net multiview control, which in turn consists of a few child view controls.
How do I make the ga.js script work with these controls? If I do it the normal way of adding the code after the tag, it will obviously count the entire page and not each of the views that are loaded.
Any help would be appreciated.
Thanks
Marky
|
|
|
|
|
Hello,,
I am using asp.net 1.1 and crystal report 11.
reports displayed in I.E 7 correctly but when I have tested it in FireFox and opera
its missed up...
Yes. CreatiVity withOuT limiTs
|
|
|
|
|
hi everybody,
i developed an web service with asp.net and publish it from IIS. when i call it from my local everything is ok. but try to reach from a remote computer the response become HTTP 400 BAD REQUEST, in this case i can take the content and send an error response.
how can i solve this problem?
|
|
|
|
|
You need to investigaet the differences between your local and remote comp, it could be the remote doesnt have correct user access or rights, it might be something like this
|
|
|
|
|
Apart from the questio in the subject line what can be other possible scenarios when new session id could be generated?
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
opening and closing a browser
|
|
|
|
|
ASP.NET 2.0 onwards session id will be generated on each request if you are not keeping any data on session. It will be regenerated for new browser instances too.
|
|
|
|
|
Thanks for reply.
I am using asp and the site moves from http to https pages.
When I check the cookies, I get one session id as secured and other as unsecured.
What can be the cause?
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
i will give text in .aspx page but this text value store in .pdf file then display this .pdf file with this text value
|
|
|
|
|
That's good. But what's your issue !
|
|
|
|
|
Please read the guide on how to ask questions at the top of the forum. Rule #1 - use a meaningful subject, 'question' means nothing, they're all questions.
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 have a asp web application which works for both http and https protocols.
I have secured the ASPSessionId in the metabase. While testing I still get it unsecured.
Any reasons why this is happenning?
how can I secure the sessionids?
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
Hi
I was talking about somethign similar on the 2nd page but thought better to start a new post in case no one looked on the 2nd page
Basically i have a for loop and in it I need to add items to a listbox
I have the following but I am getting an error message:
foreach (DataRow row in dataSetactorder.Tables[0].Rows)
{
listboxact.Items.Add (row[0]);
}
error: " The best overloaded method match for 'System.Web.UI.WebControls.ListItemCollection.Add(string)' has some invalid arguments
"
any help would be great cheers
|
|
|
|
|
.netman wrote: The best overloaded method match for 'System.Web.UI.WebControls.ListItemCollection.Add(string)' has some invalid arguments
The error message clear enough. It requires a string type, but you are supplying DataRow . It could be something like
foreach (DataRow row in dataSetactorder.Tables[0].Rows)
{
listboxact.Items.Add (row[0].ToString());
}
modified on Wednesday, April 9, 2008 4:54 AM
|
|
|
|
|
ok ive filled up the listbox and now I want to check if any of the values in the listbox match a value from a text box
WHat is the best way to do this
ive got the following - stallactorder being the string result from the listbox and updateact the string value from the textbox
How can i assign the values from a listbox to a string, or is there a better way to do it?
pesudo code would be
if listbox contains a value which matches textbox
{
}
actual code so far
if (stallactorder.Trim().Contains(updateact))
any help would be great
cheers!
|
|
|
|
|
I think you are following to my reply for your last post yesterday. In that I haven't meant to use a list box. I was suggesting to use List<string> class. It has a Contains() method and you can take the string easily from it.
|
|
|
|
|
Hi!!
try the below code
for (int i = 0; i <= ListBox1.Items.Count - 1; i++)
{
if (ListBox1.Items[i].ToString() == TextBox1.Text)
{
//your statement
}
}
|
|
|
|