ارسال کد html به صورت داینامیک در تگ body یا ...
من دارم با C# یک وب سایت طراحی میکنم
حالا چه طور میشه با استفاده از Response.Write)( یا هر دستور دیگری در بخش
protected void Page_Load(object sender, EventArgs e)
{
}
یک کد html رو در تگ body چاپ کرده و به واسطه اون مثلا یک جدول بکشیم
(مشکل اصلی تعین محل چاپ کد مورد نظر به وسیله Response.Write در قسمتهای مختلف سند html)
من این کاری رو که شما گفتید انجام دادم ولی با این خطا موجه شدم
من این کاری رو که شما گفتید انجام دادم ولی با این خطا موجه شدم
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 13: protected void Page_Load(object sender, EventArgs e)
Line 14: {
Line 15: dynamicTbl.InnerHtml = "ascasc sdfgsegseg";
Line 16: dynamicTbl.InnerHtml += "<tr><td><b>جدول داینامیک</b></td></tr>";
Line 17: dynamicTbl.InnerHtml += "</table>";