|
try following code
if(((Button)Sender).ID=="Delete")
else if(((Button)Sender).ID=="Edit")
beSt RegArd
pAthAn
|
|
|
|
|
Imran Khan Pathan wrote: try following code
if(((Button)Sender).ID=="Delete")
//delete button is fired.
else if(((Button)Sender).ID=="Edit")
//Edit button is fired
WHY ? Where do you write this code ? How the event fires ? This will work if both the buttons are attached to same event.
|
|
|
|
|
If you have multiple event and use single method base on that event then it will be used.
like as gridview's RowCommand event
best regard
pathan
|
|
|
|
|
Hello Sir,
Here i'm explaining my prob. again. Plz get a bit of time to look over it.......
I have a web page. This page contains a PlaceHolder and this placeholder brings or holds some links created by the admin at runtime. Not when we design the page i mean there is no exact no. of the links to be created by the admin. Let an admin create Four links like Jan,Feb,Mar,Apr.....
Now i want as the client clicks on Jan link then a panel or imageButton should display the image of month Jan and if he/she clicks on Feb link then image of Feb month should display
|
|
|
|
|
The Knowledge wrote: i've also created an event to check which button is clicked.......
To which button that event is attached ? This will be fired when the button which is attached to this event gets clicked. Then why you want to find which button is clicked. ?
|
|
|
|
|
Do one thing initialze the single event for every button and then in that function check which button selct simple by checking the id
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... "
|
|
|
|
|
Do you mean that you want to handle the click event of two button's in a single event?
Regards - J O N -
|
|
|
|
|
Hello Sir,
Here i'm explaining my prob. again. Plz get a bit of time to look over it.......
I have a web page. This page contains a PlaceHolder and this placeholder brings or holds some links created by the admin at runtime. Not when we design the page i mean there is no exact no. of the links to be created by the admin. Let an admin create Four links like Jan,Feb,Mar,Apr.....
Now i want as the client clicks on Jan link then a panel or imageButton should display the image of month Jan and if he/she clicks on Feb link then image of Feb month should display
|
|
|
|
|
is it possible to set the position of an output
I am fetching product name and the corresponding link from the database i want to display the product name and when click on it i have to go the corresponding page.search button ia also there.the products similar to that we typed will also have to display.that's why i am using response.write.But I don't want to display these at the beginning of the page.if anyone have a solution for this plse send.
|
|
|
|
|
i didnt quite really get ur question.pls be specific
Cheers
Bino
www.codepal.co.nr
|
|
|
|
|
i want to display the output at a specific position in the page without using contols.ie,using response.write
|
|
|
|
|
use a div and position it anywhere in ur page.then write ur content to the div.
Cheers
Bino
www.codepal.co.nr
|
|
|
|
|
Hello All,
Can we Debug the Javascript? If yes then how...'
Regards
Aavesh
|
|
|
|
|
r u using .Net? then just put a debugger just before the position u need to debug.Now it will act as a breakpoint.
syntax
debugger;
Cheers
Bino
www.codepal.co.nr
|
|
|
|
|
Thanks for ur reply..i will check it...
Avesh
|
|
|
|
|
MS Script Debugger is good for this. But I always prefer to use firefox which shows what is the error in it's error console.
|
|
|
|
|
The best option is to install firefox and the firebug add in.
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 )
|
|
|
|
|
My blog website is supposed to be an asp.net application. And I am a total asp.net newbie. I have handled the back end process, i.e. posting the 'newly composed blog post' to database, via client script.
Now how do I view my new post directly or rather make my application navigate to the new post automatically. The steps involved for this process would be something like:
1. Find the new ID of the post (Any suitable logic used here, but I plan to definitely query my database for it!)
2. Navigate to that page. (This is what I am trying to achieve from client-end!!!)
If I were to do step 2 on the server I could write something like
Response.Redirect("ViewPost.aspx?blogID=" & blogIDFromDatabaseQuerying.ToString())
How do I accomplish the above from the client?
|
|
|
|
|
deostroll wrote: Find the new ID of the post (Any suitable logic used here, but I plan to definitely query my database for it!)
I'd prefer using an output variable and returning the id inserted. Assign this id to a public variable, and can be used in javascript for redirection.
var BlogId = <% =PublicVaribleForBlogId %>;
window.location.href = "ViewPost.aspx?blogID=" + BlogId
|
|
|
|
|
N a v a n e e t h wrote: window.location.href = "ViewPost.aspx?blogID=" + BlogId
won't take me to the proper location. If I had used this what appears on my address bar is something like: ViewPost.aspx?blogID=26
where as if I did a response.write I'd get it as
http://localhost/website/ViewPost.aspx?blogID=26
There is a difference...!
|
|
|
|
|
deostroll wrote: won't take me to the proper location. If I had used this what appears on my address bar is something like: ViewPost.aspx?blogID=26
Yes correct. You have to alter the redirect URL depends on your actual URL. I was just giving a demo. Hope it's working
|
|
|
|
|
Is there no way of using the server's functionality? I was thinking calling this "functionality" via client code somehow... So ultimately you are suggesting that I must "manually" edit my script to reflect a production scenario...? No other go?
|
|
|
|
|
Code what I suggested works on client side. It takes the public variable value from server. Then what's the issue here ?
|
|
|
|
|
Hey the code works!!! All I am saying is that right now I am working with the blog on my pc; therefore as long as it is on my pc I'd have to probably set my client-side script as: window.location.href = "http://localhost:1704/website/ViewBlog.aspx?blogID=" & blogid
But once this blog goes into production, i.e. it is public, I'd have to visit the above line of code and manually change it. What if in the future the name of my website itself is changed? This is not the answer I was expecting. I had even found ways to call server code from client-side, but this does not work like a normal postback; it is simply a callback rather. And hence I cannot use Response.Redirect(). It will give error.
To see what I mean try to modify this exercise[^]. In the place where we can actually pass a parameter to our client script code try inserting a response.redirect.
|
|
|
|
|
Finally I found the answer to this myself. It is some clever script coding (I found via another forum), and some knowledge of how to submit an html form AND how to handle __VIEWSTATE (which is the hidden culprit).
In vbscript it goes something like this:
<br />
sub OnPublish()<br />
'1. Code to push post to database...<br />
<br />
'2. Code to retrieve the last post's unique ID.<br />
<br />
'3. Code to navigate<br />
CurrentPageUrl = window.location.href 'Lets assume the current page = Current.aspx<br />
CurrentPageUrl = Replace(CurrentPageUrl, "Current.aspx", "ViewBlog.aspx"<br />
<br />
'Assume the unique ID is stored in a variable "blogid"<br />
<br />
CurrentPageUrl = CurrentPageUrl & "?blogid=" & blogid<br />
<br />
document.form1.action = CurrentPageUrl<br />
document.form1.__VIEWSTATE.name = "name" 'note: write this line exactly as it is...<br />
document.form1.submit()<br />
<br />
end sub<br />
|
|
|
|