Thursday, March 22, 2012

Setting the Modal Dialog Boxs Height and Width

Hey

I tried to set the Image Button attributes dynamically like this. When the
user click on the image button, that image has to show in a modal dialog
box. I was able to do that with out any probs. But i am not able to set the
height and width of the modal dialog box. This is the code i have tried.

string strScript =
"showModalDialog(\"\\ImageView.aspx?ImgId="+row["ImageID"].ToString()
+"\""+",\"\",\"dialogHeight:250,dialogWidth:500\")" ;

imgBtn.Attributes.Add("OnClick",strScript);

is anything i am missing?

Thanks in AdvanceYes It is working for me now. I found my mistake.

I gave a , [comma] instead of ';' this to separate the dialogHeight and dialogWidth

this is working for me
showModalDialog(\"\\ImageView.aspx?ImgId="+row["ImageID"].ToString()
+"\""+",\"\",\"dialogHeight:250;dialogWidth:500\")" ;

Now it is working.

Thanks

"Gibs" <dotnet_Gibs@.yahoo.com> wrote in message news:O6h7yom8DHA.2168@.TK2MSFTNGP12.phx.gbl...
> Hey
>
> I tried to set the Image Button attributes dynamically like this. When the
> user click on the image button, that image has to show in a modal dialog
> box. I was able to do that with out any probs. But i am not able to set the
> height and width of the modal dialog box. This is the code i have tried.
>
> string strScript =
> "showModalDialog(\"\\ImageView.aspx?ImgId="+row["ImageID"].ToString()
> +"\""+",\"\",\"dialogHeight:250,dialogWidth:500\")" ;
>
> imgBtn.Attributes.Add("OnClick",strScript);
>
> is anything i am missing?
>
> Thanks in Advance
>

0 comments:

Post a Comment