parameter passing thru on click for different buttons
Expand Post »
Hi to all
am new to asp and am parcipating a project on asp in our company... here i got one prob that passing the parameter thru onclick.. i tried a lot but nothing materialize..
i have 5 buttons here.. for all buttons same function that i have to submit the form iprev.. here my prob is when i save parameter into a session variable its showing "type mismatch" when i call the function.. here i given my codes and function nooooo sub.. plz if u can guide me plzzzzzz
Re: parameter passing thru on click for different buttons
no am getting the value of imgno inside the function...
after that i cannot assign it to a session variable..
if its not possible is thr any other ways to pass the parameters.....(other than url querystring)
Re: parameter passing thru on click for different buttons
Then your session variable is not setting correctly. You should have no problem retrieving and setting that imgno. The problem happens when you set the name of the session variable. Do you have to have a unique string on it as each session is only used by one computer? Try removing the strSUnique OR try resetting the value of strSUnique inside your sub. I know by removing it, it will work. It may work if you redeclare the variable in your sub.
Re: parameter passing thru on click for different buttons
but its showing session is not a keyword when i put it inside the sub or function which is inside the vbscript. but outside the vbscript its working.. and another thing after removing vbscript tag when i click the button it should call the function but its showing object expected which is that function... think i am totally confused............
now i tried like this.. working but whatever button i clicked its returning the value "5" for session variable.. cannot understand... can u plzzzzz if u found any prob here plzzzzz let me know.. coz i already taken 3 days for this........ plzzzzzzzz
Re: parameter passing thru on click for different buttons
the reason why your last code isn't working like you thought is because you are calling the <% %> when the server runs the code. Therefore, you are essentially setting session("imagecap...) 5 times, with firs 1, then 2, then 3, and ending in 5. This is why it will always be 5. Sorry I missed this before, but vbscript does not set values without the "SET" before the word.
set Session("imagecap" & strSUnique) = "#"
Unfortunatley I don't believe this will work because vbscript does not work with sessions this way. Your only way to make it work is to put it all in a form and send it back to itself, or to the next page with hidden input fields. Do something like this below:
Re: parameter passing thru on click for different buttons
hei this is some good logic but not working..
here my hidden field doesnot accept the value i think..
i forgot to say another thing .. my form tag is..
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.