hello ,
I have created a share point webpart using c# code ( with no aspx file ). and i have a line in with i have added a link and i would like that the link should be opened in a modal dialog window like in sharePoint.
my code is :
str2 = string.Concat(new object[] { obj2, "<p>", this.FirstWords(this.StripTagsCharArray(item[this.BodyField].ToString()), Convert.ToInt32(this.NumWords)), "... <br/><a href=\"",web.Url, "/Lists/", this.Text, "/DispForm.aspx?ID=", item.ID, "\" > read more</a></p></div></div></div>" });
I have referenced the function that open url in modal dialog window like this :
string str = "<script type=\"text/javascript\">function OpenDialog(URL) {var options = SP.UI.$create_DialogOptions();"+" options.url = URL; options.width = 600; options.height = 400; SP.UI.ModalDialog.showModalDialog(options);}</script>"
I would like to call my function in the href attribute of my link "red more" but i get syntax error because of special characters.
How to call this function correctly ?
Thanks.