|
.netman wrote: Response.AppendHeader("Refresh", "60;URL=Page.aspx");
is it working at ur side.
i tried this code at button click. both the forms are open.
It is not working.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
If you open a child form with javascript you have a reference to the new window.
You can use this reference to reset the location of the child window, therefore refreshing it.
<script type="text/javascript">
var childWindow;
function openPop()
{
childWindow = window.open('HTMLPage2.htm','name','height=400,width=200');
}
function refreshPop()
{
childWindow.location = childWindow.location;
}
</script>
|
|
|
|
|
Following is the code i am using to alert the user to press ok or cancel in the c# code behind file
string str = "confirm('ok?');";<br />
ScriptManager.RegisterStartupScript(this, typeof(Page), "", str, true);
i know , i can do the same at the java script end , I am asking this because i am executing these lines in between the function .
Now my question is can i programatically check whether the ok button is clicked or the cancel button is clicked ?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
So, this just gets run wen they page loads ? And you want to know where, what was pressed ? Why would you have a page reload so you can show a confirm dialog ?
Obviously, if you don't store the button result somewhere, your code behind is never going to know what it was.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Sir , i am executing these lines on the button click , there in the function , these lines executes after five lines ,
Christian Graus wrote: Obviously, if you don't store the button result somewhere, your code behind is never going to know what it was.
Sir , i don;t know how to store the message box button result , can u put some light .
Thank You
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
OK, so you just didn't post all the code ?
The best way to pass a value back to your codebehind is to store it in a hidden field. Then yuo need to write the client side Id of the hidden field so you can access it from your script ( easy, seeing as you're spitting out your script from your code behind already )
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
First i am sorry for these cross questioning , But i don't believe it is a bad idea until the question gets resolved.
Is ur suggestion valid if i am not writing script in the html , i mean i am writing it in the code behind , can i still store the value in hidden field ? How ?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Pankaj Garg wrote: Is ur suggestion valid if i am not writing script in the html , i mean i am writing it in the code behind , can i still store the value in hidden field ? How ?
Why would it make any difference where the script comes from ? Either way, you need a server control, which is a hidden field, and you need to have the client side id of that control, in your script, so you can store a value in it.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Couldnt you just check if the string contained Yes or No? or am I missing the point
|
|
|
|
|
sir i did not get ur point
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas
|
|
|
|
|
Dim str As String = "var i=confirm('ok?');alert(i);"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "message", str, True) ---try this one mr
|
|
|
|
|
how should i use the value of i in the conditional operator (code behind file)
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
iam using an iframe which is editable it is working fine but the when iam pressing enter it is getting the cursor long distacnce in the before word how to get that cursor closer bottom to the top text ...
in my ifame it is looking like this when press enter
example1
emamle 2 like this it is comming how can i make it closer.like our code project sending message
|
|
|
|
|
i want a code for calculating the length of one textbox 1 and that count should be displayed in another textbox 2, if the length exceeds 160 characters it should display a alert message one credit is used want to continue ? if he press ok allow him to continue and count it as asecond credit if he press cancel does not allow him to enter text in textbox 1 .
please provide me the code , iam using asp.net and c#
plz help me in this . urgent.
|
|
|
|
|
Hi I wouldn't use the word Urgent, people tend not to reply to the post when you do this.
Im sure what you are posting has an answer on google somewhere its not that complicated, search for validating input lengths
|
|
|
|
|
pavankumar makena wrote: please provide me the code , iam using asp.net and c#
plz help me in this . urgent.
Please don't say that. To you, it's urgent. To us, you're just another guy who is not willing to do any work, or use google.
You need to read some basics.
1 - C# does not run on the client side, it cannot show the user an alert
2 - javascript is what runs on the client. Doing this on the client is pretty trivial, often you need to write some code to pass the client side Id of your textbox through to your script, but in this case you will just write event handlers, and can pass the textbox through to your script using 'this'
Christian Graus - Microsoft MVP - C++
"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 want a sample code for how to retrieve the values of dynamically generated text box controls at runtime. One thing I ve more number of textbox controls and also generated ids for that controls. i added this controls into a placeholder. but i dont know to retrieve those values in the action of button...
can someone help me...
Thanks
Gopinath.R
|
|
|
|
|
Do you mean you want to catch the values of the textboxes when the button is clicked?
|
|
|
|
|
Yes I meant the same thing which u got... can u give some small example to catch the values... plz help me...
Gopinath.R
|
|
|
|
|
surely it would just be as simple as using a button event and then applying all the textbox values to string values.. or am I missing the point
|
|
|
|
|
Do you mean on the server or client ?
If the server - your main issue is going to be that dynamically created controls need to be created before page load, or viewstate is lost
If the client - your main issue is going to be knowing the client side Ids of your controls ( but this is far easier to deal with )
For the server, I'd create a hidden control, and store the values as XML or something, so that you can get them from viewstate
for the client, just write javascript creating an array of names using the CLientID property of your textboxes.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hello friends,
My gridview contains a Select button and one more link button. If I click a link button, how i will get the index of the row for which i click the button...Help me...Thanks ...in advance..
Amit
|
|
|
|
|
I think you want to use something like
GridView.rows etc and then specify which row
hmm hope that makes sense!
i would search google for how to find the index plenty of exanmples out there
|
|
|
|
|
Hi all,
What is the use of using our own web service in asp.net instead of using ordinary class files for defining functions.. what is the benefit of using web service.......
Thnk u!
Ashok
|
|
|
|
|
I think you've missed the point of webservices. They are not used for what you're describing. They are used to provide an online interface for other programs to interact with your code. You'd never choose a web service over normal classes, you would define a service as a public interface that uses your normal classes, for things you want to offer a third party access to.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|