Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1061: 'ASP.edit_user_aspx' does not contain a definition for 'Button2_Click' and no extension method 'Button2_Click' accepting a first argument of type 'ASP.edit_user_aspx' could be found (are you missing a using directive or an assembly reference?) Source Error: Line 35: <tr> Line 36: <td colspan="2" dir="rtl"> Line 37: <asp:Button ID="Button2" runat="server" BackColor="#CC33FF" Font-Bold="True" Font-Names="B Yekan" Height="41px" OnClick="Button2_Click" Text="ثبت ویرایش" Width="156px" /> Line 38: <asp:Label ID="Label1" runat="server" Text="ویرایش شد." Visible="False" ForeColor="#FF0066"></asp:Label> Line 39: </td>
درود بر شما
من صفحه ویرایش کاربر دارم که اطلاعات ویرایش میشه ودر آخر روی دکمه ثبت زده میشه ، من این کد رو از پروژه دیگه ام Copy و در اینجا Past کردم و در پروژه قبیلم درست جواب میداد اما در اینجا این خطا رو میده.
لطفا رهنمایی کنید.
سپاس
روی Button2 دوبار کلیک کنید تا رویداد ساخته بشه و بعد مشکل برطرف میشه
الان این خطا رو میده:
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 15: if (!IsPostBack) //avalin bari ke dar safhe gharar migiry in etefagh biofte Line 16: { Line 17: int UserId = int.Parse(Request.QueryString["UserId"].ToString());//az q.s ke dar page ghabl pas dade shode estefade konim Line 18: string con = "Data Source=.;Initial Catalog=Web Programming;Integrated Security=True"; Line 19: SqlConnection connect = new SqlConnection(con);
UserId
را دوباره ارتبا دادم و مشکلم حل شد.
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)