locked
On javascript confirm - Open new window passing in databound value and append another param to querystring. RRS feed

  • Question

  • User1909155429 posted

    i have the following code that shows a small image and when clicked opens a larger image in new browser window.

    I now want to be able to ask user a question of where he wants to save image either on disk or view in browser window. If  answer is 'YES' then i want to pass another param to handler page that will allow me to decide which code to run.

    <a onclick="updateQueryStringParameter(this.href);" href="javascript:void(window.open('<%# Eval("PrimaryKey", "FullImage.ashx?ID={0}") %>','_blank','toolbar=no,menubar=no'))" > <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("PrimaryKey","ThumbNailImage.ashx?ID={0}") %>'/> </a>

    When i tried passing url and adding "&type=2" to string nothing happened? 

    Thursday, August 27, 2020 7:53 PM

All replies

  • User1535942433 posted

    Hi peterthegreat,

    Accroding to your descsription,I suggest you could check follow these:

    1.Whether the url and type were successfully delivered to code-behind.

    2.What does the meanings of nothing happened?When you pass type1,could it woked?Or when you pass type2,the code will handle the type1 code?

    You could post your full codes of updateQueryStringParameter and how to pass url,type to us.It will help us to solve your problems.

    Best regards,

    Yijing Sun

    Friday, August 28, 2020 6:55 AM
  • User1909155429 posted

    I managed to get it working by passing different querystring parameters to the conditions true or false on confirm click. Instead of just amending the querystring itself! my browser would not operate with the latest querystring javascript methods as examples.

    Can the internet browser read any file format? I also save pdf and xls files to database. I always thought these could only be read by specialist software packages? This is the reason i wanted to change the querystring values to reflect the format types and if not image save to disk??

    Wednesday, September 2, 2020 12:50 PM
  • User1535942433 posted

    Hi peterthegreat,

    I managed to get it working by passing different querystring parameters to the conditions true or false on confirm click. Instead of just amending the querystring itself! my browser would not operate with the latest querystring javascript methods as examples.

    So,how do you pass querystring parameters to code-behind to check the the conditions true or false?

    Do you have pass querystting successfully?Could you post full codes and more details to us?It will help us to solve your problems.

    Best regards,

    Yijing Sun

    Friday, September 11, 2020 8:53 AM