0
後面的代碼中添加jQuery時,輸入字符串的格式不正確我試着這樣做,它給出了我稱爲String.Format
的行中標題中提到的錯誤。當我試圖在
public static void JqueryDialogue(string divId)
{
String script = String.Format(
"$(document).ready(function(){ $('#{0}').dialog('open'); });",
divId);
// Gets the executing web page
Page page = HttpContext.Current.CurrentHandler as Page;
string codeId = "openDialoge" + divId.ToString();
// Checks if the handler is a Page and that the script isn't already on Page
if (page != null && !page.ClientScript.IsClientScriptBlockRegistered(codeId))
{
page.ClientScript.RegisterStartupScript(
typeof(JavascriptHelper),
codeId,
script,
true);
}
}