نمایش نتایج 1 تا 6 از 6

نام تاپیک: باز شدن پنجره ی جدید بعد از انتخاب دکمه ی ویرایش در گریدویو

  1. #1

    باز شدن پنجره ی جدید بعد از انتخاب دکمه ی ویرایش در گریدویو

    سلام و خسته نباشید

    دوستان من می خوام در گریدویو بعد از کلیک بر روی دکمه ی ویرایش صفحه ی ویرایش در یک پنجره ی جدید باز شود ، کدش رو به این صورت نوشتم ولی خطا میده

    protected void Grcat_RowDataBound(object sender, GridViewRowEventArgs e)
    {



    if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataR ow)
    {


    LinkButton btn = (LinkButton)(e.Row.FindControl("linkbtnedit"));
    btn.Attributes.Add("OnClick", "target='_blank';");


    }



    }

    __________________________________________________ _________

    متن خطا :

    Server Error in '/' Application.


    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 57:
    Line 58: LinkButton btn = (LinkButton)(e.Row.FindControl("linkbtnedit"));
    Line 59: btn.Attributes.Add("OnClick", "target='_blank';");


    _____________________________________________
    قسمت aspx

    <asp:TemplateField>
    <ItemTemplate>
    <asp:LinkButton ID="linkbtnedit" CommandArgument="<%# Container.DataItemIndex %>" CommandName="Edit" runat="server">ویرایش</asp:LinkButton>
    </ItemTemplate>
    </asp:TemplateField>

  2. #2

    نقل قول: باز شدن پنجره ی جدید بعد از انتخاب دکمه ی ویرایش در گریدویو

    سلام
    خب شما نمیتونین روی کلیک Target رو مشخص کنین
    الان حضور دهن ندارم ولی اگه LinkButton خصوصیت Target نداره شما از HyperLink استفاده کن و در قسمت Aspx مقدار خصوصیت Target رو براش تنظیم کن

  3. #3

    نقل قول: باز شدن پنجره ی جدید بعد از انتخاب دکمه ی ویرایش در گریدویو

    اگه از hyperlink استفاده کنم اونوقت خاصیت commandargument رو نداره

  4. #4

    نقل قول: باز شدن پنجره ی جدید بعد از انتخاب دکمه ی ویرایش در گریدویو

    از لینک باتن استفاده کن و براشcommandname و commandargument قرار بده
    <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Bind("TicketNumber") %>' CommandName="selectCm" Text="test" ></asp:LinkButton>

    و توی رویداد RowCommand
    protected void GridView2_RowCommand1(object sender, GridViewCommandEventArgs e)
    {
    if (e.CommandName == "selectCm")
    {
    string id= e.CommandArgument.ToString();
    String js = "window.open('../url.aspx" +encid + "', '_blank');";
    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "OpenSignature.aspx", js, true);
    }
    }

  5. #5

    نقل قول: باز شدن پنجره ی جدید بعد از انتخاب دکمه ی ویرایش در گریدویو

    ممنون از راهنمایی شما به این صورت نوشتم ولی خطا میده


    protected void Grcat_RowCommand(object sender, GridViewCommandEventArgs e)
    {
    if (e.CommandName == "Edit")
    {
    Int32 index = Int32.Parse((string)e.CommandArgument);
    string action = "Edit";

    string js = "window.open('AddCat.aspx?ID=" + Grcat.DataKeys[index].Values[0] + "&action=" + action + "', '_blank');";
    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddCat.aspx", js, true);

    }


    خطا


    __________________________________________________ ____________


    The GridView 'Grcat' fired event RowEditing which wasn't handled.


    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.Web.HttpException: The GridView 'Grcat' fired event RowEditing which wasn't handled.


    Source Error:


    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    آخرین ویرایش به وسیله panahinia : یک شنبه 23 اسفند 1394 در 13:09 عصر

  6. #6

    نقل قول: باز شدن پنجره ی جدید بعد از انتخاب دکمه ی ویرایش در گریدویو

    نقل قول نوشته شده توسط panahinia مشاهده تاپیک
    ممنون از راهنمایی شما به این صورت نوشتم ولی خطا میده


    protected void Grcat_RowCommand(object sender, GridViewCommandEventArgs e)
    {
    if (e.CommandName == "Edit")
    {
    Int32 index = Int32.Parse((string)e.CommandArgument);
    string action = "Edit";

    string js = "window.open('AddCat.aspx?ID=" + Grcat.DataKeys[index].Values[0] + "&action=" + action + "', '_blank');";
    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddCat.aspx", js, true);

    }


    خطا


    __________________________________________________ ____________


    The GridView 'Grcat' fired event RowEditing which wasn't handled.


    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.Web.HttpException: The GridView 'Grcat' fired event RowEditing which wasn't handled.


    Source Error:


    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    شما از رویداد RowEditing استفاده کردید ولی توی کد ها اون رو ندارید. میتونید از رویداد های توی گریدویو پاکش کنید مشکل رفع میشه.

تاپیک های مشابه

  1. باز شدن یک لایه جدید بعد از Mouse Hover
    نوشته شده توسط hessammt در بخش طراحی وب (Web Design)
    پاسخ: 1
    آخرین پست: دوشنبه 27 بهمن 1393, 20:37 عصر
  2. باز نشدن پنجره print option بعد از اجرای Execute در Rave
    نوشته شده توسط sara66 در بخش ابزارهای گزارش سازی در دلفی
    پاسخ: 2
    آخرین پست: جمعه 17 آبان 1392, 12:34 عصر
  3. سوال: باز شدن يك صفحه جديد بعد از كليك كردن دكمه
    نوشته شده توسط m-naderi در بخش ASP.NET Web Forms
    پاسخ: 0
    آخرین پست: چهارشنبه 22 خرداد 1392, 17:04 عصر
  4. سوال: مشکل در باز شدن صفحه جستجو گر بعد از اتصال ***
    نوشته شده توسط best99 در بخش شبکه و Networking‌
    پاسخ: 6
    آخرین پست: یک شنبه 26 تیر 1390, 01:42 صبح
  5. غیر فعال شدن گزینه لیست باکس بعد از انتخاب
    نوشته شده توسط zzzzzza در بخش Access
    پاسخ: 1
    آخرین پست: دوشنبه 15 شهریور 1389, 16:40 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •