Расширитель Modalpopup внутри другого расширителя modalpopup
gridview1 внутри modalpopupextender1 с помощью кнопки linkbutton открывает другой modalpopupextender2 с помощью gridview2.
теперь, когда я нажимаю кнопку linkbutton gridview1, которая находится внутри modalpopextender1.... modalpopupextender2 не всплывает ...и даже не показывая никаких ошибок...это просто когда я проверяю элемент в браузере, и он говорит
"
206|error|500|ERROR [HY000] [MySQL][ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using password: YES)
"
Мой файл webconfig:
<add name="connect3" connectionstring="DRIVER={MySQL ODBC 3.51 Driver}; Host=localhost;UserName=root;Password=*****;Database=welco1_all" /> <add name="connect4" connectionstring="DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; UID=root; PASSWORD=12345; OPTION=3" />
Я перепробовал почти все ...но ничего хорошего не приходит...любая помощь высоко ценится...
Что я уже пробовал:
Это мой HTML файл:
<%--Master Button--%> <asp:gridview runat="server" id="GridView1" showfooter="true" autogeneratecolumns="false" GridLines="None" CssClass="table1" OnRowCreated="GridView1_RowCreated" BorderColor="#356600" BorderStyle="Solid" > <columns> <asp:TemplateField HeaderText="Date" > <ItemTemplate> <asp:LinkButton ID="Date" runat="server" CausesValidation="false" CommandName="Date_Select" Text='<%#Eval("Date","{0:yyyy-MM-dd}") %>' onclick="Date_Click" ></asp:LinkButton> </ItemTemplate> <EditItemTemplate> </EditItemTemplate> </asp:TemplateField> <asp:boundfield datafield="" headertext="Total" footerstyle-font-bold="true" footertext="Grand Total:" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="MIns" headertext="Mins" footerstyle-font-bold="true" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="Amount" headertext="Amount" footerstyle-font-bold="true" > <FooterStyle Font-Bold="True" ></FooterStyle> </asp:boundfield> <asp:boundfield datafield="Profit" headertext="Profit" footerstyle-font-bold="true"> <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> </columns> <HeaderStyle BackColor="#CEFF99" ForeColor="Black" BorderColor="#C1FF80" BorderStyle="Solid" BorderWidth="1px"></HeaderStyle> <RowStyle CssClass="td"></RowStyle> </asp:gridview> <%--Hidden Button--%> <asp:Button ID="btnShowPopup" runat="server" Style="display: none" /> <%--Modalpopup extender For Parent--%> <ccl:ModalPopupExtender ID="mdlPopup" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlParent" CancelControlID="btnClose" BackgroundCssClass="modalBackground"> </ccl:ModalPopupExtender> <%--Parent Panel--%> <asp:Panel ID="pnlParent" Style="display: none; position: absolute; width: 500px; border: solid 1px black; height: 630px; width:800px; background-color: White; margin-left: 50px" runat="server" CssClass="modalpopup"> <asp:UpdatePanel ID="updateParent" runat="Server"> <ContentTemplate> <div style ="height:630px; width:800px; overflow:auto;"> <asp:gridview runat="server" id="GridView17" showfooter="true" autogeneratecolumns="false" GridLines="None" CssClass="table" HeaderStyle-CssClass="th" RowStyle-CssClass="td" Width="100%" AllowPaging="false" ShowHeader="true"> <columns> <asp:TemplateField HeaderText="Date" > <ItemTemplate> <asp:LinkButton ID="Customer" runat="server" CausesValidation="false" CommandName="Date_Select" Text='<%#Eval("Customer") %>' onclick="Customer_Click" ></asp:LinkButton> </ItemTemplate> <EditItemTemplate> </EditItemTemplate> </asp:TemplateField> <%--<asp:boundfield datafield="Customer" headertext="Customer" ItemStyle-HorizontalAlign="Left" footerstyle-font-bold="true" ItemStyle-Width="200px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield>--%> <asp:boundfield datafield="MIns" headertext="Mins" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"> <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="Amount" headertext="Amount" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="Profit" headertext="Profit" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> </columns> <HeaderStyle BackColor="#CEFF99" ForeColor="Black" BorderColor="#C1FF80" BorderStyle="Solid" BorderWidth="1px"></HeaderStyle> <RowStyle CssClass="td"></RowStyle> </asp:gridview> </div> <%--Close Button For Parent Modal Popup--%> <asp:Button ID="btnClose" runat="server" Text="Close" OnClientClick="$find('mdlPopup').hide(); return false;" /> <%--Target Control Button For Child Modal--%> <asp:Button ID="btnChildTarget" runat="server" Style="display: none" /> <ccl:ModalPopupExtender ID="mdlChild" runat="server" TargetControlID="btnChildTarget" PopupControlID="pnlChild" CancelControlID="btnCloseChild" BackgroundCssClass="modalBackground"> </ccl:ModalPopupExtender> <asp:Panel runat="server" ID="pnlChild" Style="display: none; width: 100%; border: solid 1px black; height: 100%; background-color: White; margin-left: 10px"> <div style ="height:630px; width:800px; overflow:auto;"> <asp:gridview runat="server" id="GridView34" showfooter="true" autogeneratecolumns="false" GridLines="None" CssClass="table" HeaderStyle-CssClass="th" RowStyle-CssClass="td" Width="100%" AllowPaging="false" ShowHeader="true"> <columns> <asp:boundfield datafield="Vendor" headertext="Vendor" ItemStyle-HorizontalAlign="Left" footerstyle-font-bold="true" ItemStyle-Width="200px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="Region" headertext="Region" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"> <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="MIns" headertext="Mins" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="Amount" headertext="Amount" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="V_Mins" headertext="V_Mins" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="V_Amount" headertext="V_Amount" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> <asp:boundfield datafield="profit" headertext="Profit" footerstyle-font-bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" > <FooterStyle Font-Bold="True"></FooterStyle> </asp:boundfield> </columns> <HeaderStyle BackColor="#CEFF99" ForeColor="Black" BorderColor="#C1FF80" BorderStyle="Solid" BorderWidth="1px"></HeaderStyle> <RowStyle CssClass="td"></RowStyle> </asp:gridview> </div> <asp:Button ID="btnCloseChild" runat="server" Text="Close" OnClientClick="$find('mdlChild').hide(); return false;" /> <%--<asp:Button ID="btnChild" runat="server" OnClick="btnChild_Click" Text="Send Value To Parent" />--%></asp:Panel> </ContentTemplate> </asp:UpdatePanel> </asp:Panel>
А это мой файл. CS:
protected void Date_Click(object sender, EventArgs e) { LinkButton Lnk = (LinkButton)sender; //Label2.Text = Lnk.Text; TextBox1.Text = Lnk.Text; //date = TextBox1.Text; //TextBox3.Text = Lnk.Text; OdbcConnection con1 = new OdbcConnection(ConfigurationManager.ConnectionStrings["connect1"].ConnectionString); OdbcCommand cmd = new OdbcCommand("select a.customer As Customer,a.mins as MIns,a.amount as Amount,a.profit as Profit from summarydatashort a,clientsrecord b where a.orig_clli=b.orig_clli and a.date='" + TextBox1.Text + "' and b.emplye='Ankit'", con1); con1.Open(); OdbcDataAdapter da = new OdbcDataAdapter(cmd); da.Fill(ds); con1.Close(); GridView17.DataSource = ds; GridView17.DataBind(); //GridView17.DataSourceID = String.Empty; mdlPopup.Show(); //Label2.Text = "Details of Ankit on " + " " + TextBox1.Text; } public void Customer_Click(object sender, EventArgs e) { // modalPopUpExtender1.Hide(); //string QueryString= TextBox1.Text; //Page.ClientScript.RegisterStartupScript(GetType(), "", "window.open('Default2.aspx?QS=" + QueryString + "','','width=500,height=500');"", true); //DataSet dspop = new DataSet(); LinkButton Lnk = (LinkButton)sender; //Label2.Text = Lnk.Text; TextBox5.Text = Lnk.Text; //TextBox3.Text = Lnk.Text; OdbcConnection con1 = new OdbcConnection(ConfigurationManager.ConnectionStrings["connect4"].ConnectionString); OdbcCommand cmd = new OdbcCommand("select orig_clli as Origclli from welco_all.clientsrecord where customer='" + TextBox5.Text + "' ", con1); con1.Open(); OdbcDataAdapter da = new OdbcDataAdapter(cmd); DataSet dscust = new DataSet(); using (OdbcDataReader read = cmd.ExecuteReader()) { while (read.Read()) { TextBox6.Text = (read["Origclli"].ToString()); //TextBox6.Text = (read["password"].ToString()); } read.Close(); } con1.Close(); string date = TextBox1.Text.Replace("-","_"); OdbcConnection con = new OdbcConnection(ConfigurationManager.ConnectionStrings["connect3"].ConnectionString); OdbcCommand cmd2 = new OdbcCommand("SELECT a.orig_clli, b.clli_name as Vendor, a.region as Region, round(sum(a.billedSeconds/60),2) as MIns, round(sum(a.amount),4) as Amount, round(sum(a.v_billedSeconds/60),2) as V_Mins, round(sum(a.v_amount),4) as V_Amount,round(sum(a.amount)-sum(a.v_amount),2) as profit from welco1_all.az_outbound_cdr_" + date + " a,welco1_all.outbound_vendor_master b where orig_clli in('" + TextBox6.Text + "') and a.term_clli=b.clli GROUP BY a.term_clli, a.orig_clli, a.region ORDER BY a.term_clli, a.orig_clli, a.region", con); //SELECT a.orig_clli, b.clli_name as Vendor, a.region as Region, round(sum(a.billedSeconds/60),2) as MIns, round(sum(a.amount),4) as Amount, round(sum(a.v_billedSeconds/60),2) as V_Mins, round(sum(a.v_amount),4) as V_Amount,round(sum(a.amount)-sum(a.v_amount),2) as profit from welco1_all.az_outbound_cdr_"+date+" a,welco1_all.outbound_vendor_master b where orig_clli in('" + TextBox6.Text + "') and a.term_clli=b.clli GROUP BY a.term_clli, a.orig_clli, a.region ORDER BY a.term_clli, a.orig_clli, a.region //try //{ con.Open(); OdbcDataAdapter da2 = new OdbcDataAdapter(cmd2); da2.Fill(dsnewpop1); con.Close(); GridView34.DataSource = dsnewpop1; GridView34.DataBind(); mdlChild.Show(); //} //catch (Exception er) //{ // throw (er); //} //Label20.Text = "Details of Umesh on " + " " + TextBox1.Text; }
Herman<T>.Instance
НЕ КРИЧИ ПОЖАЛУЙСТА
mridulkoul123
у вас есть какие-нибудь советы по этому поводу???
Herman<T>.Instance
НЕ ИСПОЛЬЗУЙТЕ ТОЛЬКО ЗАГЛАВНЫЕ БУКВЫ
Richard Deeming
Ваш код уязвим для SQL-инъекция[^]. НИКОГДА используйте конкатенацию строк для построения SQL-запроса. ВСЕГДА используйте параметризованный запрос.
Все, что вы хотели знать о SQL-инъекции (но боялись спросить) | Трой Хант[^]
Как я могу объяснить SQL-инъекцию без технического жаргона? | Обмен Стеками Информационной Безопасности[^]
Шпаргалка по параметризации запросов / OWASP[^]