Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all 5678 articles
Browse latest View live

AjaxControlToolkit 4 version doesn't go on aruba server (windows hosting)

$
0
0

Good morning,

I've cerated a new solution in framework 4.0 where i have a page withis code ( see belowe):

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"><ajaxToolkit:ToolkitScriptManager runat="server" id="ToolkitScriptManager2"></ajaxToolkit:ToolkitScriptManager><asp:HiddenField ID="hidForModel" runat="server" /><ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="hidForModel"
			PopupControlID="pnlpopup" CancelControlID="btnCancel" BackgroundCssClass="modalBackground"
			RepositionMode="RepositionOnWindowScroll"></ajaxToolkit:ModalPopupExtender><asp:Panel ID="pnlpopup" runat="server" Style="width: 400px; background-color: transparent;"><div class="boxPrincipale_area"><div class="boxtitolo_boxPrincipale_area"><div style="overflow: hidden; clear: left; padding: 2px"><div style="float: left; width: 335px; margin-top: 5px; text-align: left" id="divTitoloFinestraMsg"
							runat="server"><asp:Label ID="lblTitoloFinestraMsg" runat="server" Text="" Visible="true" CssClass="testoTitoloMsgFinestra"></asp:Label></div><div style="float: right"><asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/PRIVATE/img/chiusura_finestra2.png"
								OnClientClick="javascript: ModalPopupExtender2.Hide(); e.processOnServer = false; return false;"
								ToolTip="Chiudi la finestra" /></div></div></div><div style="width: 335px; padding: 12px;" id="divMessage2" runat="server" class="testoMsgFinestra"></div></div></asp:Panel></asp:Content>

Then the  web.config code ( see belowe):

<?xml version="1.0" encoding="utf-8"?><!--
  Per ulteriori informazioni su come configurare l'applicazione ASP.NET, visitare il sito Web all'indirizzo
  http://go.microsoft.com/fwlink/?LinkId=169433
  --><configuration><system.web><sessionState timeout="60" mode="InProc" cookieless="false" /><globalization culture="it-IT" uiCulture="it-IT" /><compilation debug="true" strict="false" explicit="true" targetFramework="4.0"><assemblies><add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /><add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /><add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /><add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /><add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /></assemblies>        </compilation><authentication mode="Forms"><forms name="form_login" loginUrl="validate.aspx" timeout="2880" /></authentication><httpRuntime maxRequestLength="50000" executionTimeout="1800" /><customErrors mode="Off" defaultRedirect="ErrorNotspecified.htm"><error statusCode="404" redirect="Error404.htm" /><error statusCode="408" redirect="Error408.htm" /><error statusCode="418" redirect="Error418.htm" /><error statusCode="503" redirect="Error503.htm" /></customErrors><pages enableEventValidation="false" controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"><controls><add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /></controls></pages></system.web><location path="PRIVATE"><system.web><authorization><deny users="?" /></authorization></system.web></location></configuration>

But i see the error (see belowe)

Errore server nell'applicazione '/'.
Eccezione di sicurezza
Descrizione: L'applicazione ha tentato di eseguire un'operazione non consentita dai criteri di sicurezza. Per attribuire all'applicazione le autorizzazioni necessarie, contattare l'amministratore del sistema oppure modificare il livello di attendibilità dell'applicazione nel file di configurazione.

Dettagli eccezione: System.Security.SecurityException: Richiesta di autorizzazione di tipo 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' non soddisfatta.

Errore nel codice sorgente:

Durante l'esecuzione della richiesta Web corrente è stata generata un'eccezione non gestita. Per informazioni sull'origine e la posizione dell'eccezione, vedere la traccia dello stack dell'eccezione riportata di seguito.

Traccia dello stack:


[SecurityException: Richiesta di autorizzazione di tipo 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' non soddisfatta.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
   System.Security.CodeAccessPermission.Demand() +46
   System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +99


Informazioni di versione: Versione di Microsoft .NET Framework:4.0.30319; Versione di ASP.NET:4.0.30319.272 

Why i can't to use the ajaxToolkit:ModalPopupExtender with ToolkitScriptManager on Aruba server with hosting Windows?

<ajaxToolkit:ToolkitScriptManager runat="server" id="ToolkitScriptManager2"></ajaxToolkit:ToolkitScriptManager>

Can you help me?


Tab Panels become invisible after upgrading to AJAX Control Toolkit v15.1

$
0
0

My current environment is Microsoft.Net 4.5.2, Visual Studio 2013, AJAX Control Toolkit v15.1. Ever since I upgraded to AJAX Control Toolit v15.1 and use the asp:Scriptmanager instead of the old ToolkitScriptmanager, the tab panels in my tab container become invisible. I think an exception thrown by Javascript when the page is being rendered caused the problem but I don't know how to fix this. 

Any suggestion on where to look is deeply appreciated.

Here's an example of a simple page:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Edesk.WebForm1" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server">
<ajaxToolkit:TabPanel runat="server" HeaderText="Details" ID="TabPanel1" TabIndex="0">
<ContentTemplate>
<table><tr><td>Test details</td></tr></table>

</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Scope">
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="Approval">
</ajaxToolkit:TabPanel>

</ajaxToolkit:TabContainer>
<table><tr><td>Test table under tab control</td></tr></table>

</div>
</form>
</body>
</html>

When I run debug I get this error:

Unhandled exception at line 3803, column 12 in http://localhost:56421/ScriptResource.axd?d=LA2uNqtVhxzSGcXjgWiXWMzwtqbnPMUmRP9jH3h0X6l82MORXTdoPhq1uVWN6VYHPOyBjTaf96dObBwHQpWSfAWO9cGXljZJKqL2EtTfofM9x-QAHX3fvuZzmFwummfX2NiNhZ1WtVY-5aKut_Ye8i1-cxlSl5eUqSchmx80oaZ9HLdNmraaCLX7x8ky1_N80&t=7b689585

0x800a139e - JavaScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined.

Here's what it looks like after I break: (The undelined one is the one where the error was reported)
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>

</title><link href="/WebResource.axd?d=qe1K4yw3-S9lnWs4RN4S8DFFbZW4pMW5u1dgcADSKj07HTKa_6_rhZvAU-zpA1YcjsT-MLLQ_ifDnTyiUH3-VPOy1bJ3ywHt6i-MkBlLaU1PkSgnqAoOHL5pkXYWkwnEc09vKeBsV-60KlPmrNrnmg2&amp;t=634092594280000000" type="text/css" rel="stylesheet" /></head>
<body>
<form method="post" action="WebForm1.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="TabContainer1_ClientState" id="TabContainer1_ClientState" value="{&quot;ActiveTabIndex&quot;:0,&quot;TabState&quot;:[true,true,true]}" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTAxMTYyMTYwZBgCBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUNVGFiQ29udGFpbmVyMQUNVGFiQ29udGFpbmVyMQ8PZGZkNm1GtdTdJ5/3/lOaD5Wq4CYJuaVbE6nEOYWiXTSx7OI=" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>


<script src="/WebResource.axd?d=DXR2C7BtsWBM5RxNKJ3EGdP3ueU1hjhDmKj-teHH1yJ3uk0Z-jX-SngoJDkJJlEZI4w-ZwqWqrb1cPDiUe3zwDgqw99dcG4T6joaCVIU-U41&amp;t=635586505120000000" type="text/javascript"></script>


<script src="/ScriptResource.axd?d=LA2uNqtVhxzSGcXjgWiXWMzwtqbnPMUmRP9jH3h0X6l82MORXTdoPhq1uVWN6VYHPOyBjTaf96dObBwHQpWSfAWO9cGXljZJKqL2EtTfofM9x-QAHX3fvuZzmFwummfX2NiNhZ1WtVY-5aKut_Ye8i1-cxlSl5eUqSchmx80oaZ9HLdNmraaCLX7x8ky1_N80&amp;t=7b689585" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>
</script>

<script src="/ScriptResource.axd?d=zy5Y5fmxYRZYoedEaWXHIv14lFzsDjttP1jlGo3uEW9L6at1v3uuNyPaKRTIguo5nMJcDLPksb34WiNjUkWLLWhkkiN7M-EFnOIl202-qIZdGqlC0yI0isI288LtUJSkyzWAITLS9TUA-HozYrX5LKUQ9KHnhQIG29QFo6CzQBO56DLdBKjJmbN0BAdv4OMq0&amp;t=7b689585" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=ba3UywKW6ykZA552fgoRrpUpL_o8gIWoPW_j54RhhKB4ft5xwPFnLznuQvReED-0-P9UjwzYq51SoLKx31vS2kSvBKaD7bL-oVbQP8jXOrHfZMVJXZuXhdH9_EqG-VRRrmvEt-kJTYIeMuxDxp_4ew2&amp;t=ffffffffec54f2d7" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=M8Ym2BQZY9GlRden7H89IkiCgsLxQIERImV5eypug9sPJo_UKQz8nVlj9GZMQ5PG_Vx9E5i9mffiqTTLoH5JPNBg62BlvT6lSkpL-qXwY3AwKPPdEC7BoZ8cLqGRkQ4GEf1B4gNU40hlospYzarYvg2&amp;t=ffffffffec54f2d7" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=B-FU554SCPpYcmXPz3tx9i0pLty-iYb7etkeddi1TrMifc4ClQjasKcVjdomJe5n-msKdzAuiCq5v2IAV_NTI0nQor_TH6uJ7Zqhnuvqw_cnPf9EQoZulJgg5igm7r8o0&amp;t=ffffffffec54f2d7" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=RgAIaWnD3gxf282AFAByL7Tm8D2AW_6WufS1PdZgtLuAvT4AO3YF5gwDwuGqkKzRjqOyRRi0Cw567bSGNCn4q16MY3ygNOi5iYjYlnFZUMI8qPCeHmX4filu49BJPrt64wNMNYwplFTfybxZ5SOCvGyHKVf5IpUAs96vhoqlJp41&amp;t=ffffffffec54f2d7" type="text/javascript"></script>
<div>

<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ScriptManager1', 'form1', [], [], [], 90, '');
//]]>
</script>

<div class="ajax__tab_xp" id="TabContainer1" style="visibility:hidden;">
<div id="TabContainer1_header">
<span id="TabContainer1_TabPanel1_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_TabContainer1_TabPanel1">Details</span></span></span></span><span id="TabContainer1_TabPanel2_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_TabContainer1_TabPanel2">Scope</span></span></span></span><span id="TabContainer1_TabPanel3_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_TabContainer1_TabPanel3">Approval</span></span></span></span>
</div><div id="TabContainer1_body">
<div id="TabContainer1_TabPanel1" class="ajax__tab_panel">

<table>
<tr>
<td>
Test details
</td>
</tr>

</table>

</div><div id="TabContainer1_TabPanel2" class="ajax__tab_panel" style="display:none;visibility:hidden;">

</div><div id="TabContainer1_TabPanel3" class="ajax__tab_panel" style="display:none;visibility:hidden;">

</div>
</div>
</div>
<table>
<tr>
<td>
Test table under tab control
</td>
</tr>

</table>
</div>

<div class="aspNetHidden">

<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="C687F31A" />
</div>

<script type="text/javascript">
//<![CDATA[
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.TabPanel, {"headerTab":$get("__tab_TabContainer1_TabPanel1"),"ownerID":"TabContainer1"}, null, {"owner":"TabContainer1"}, $get("TabContainer1_TabPanel1"));
});
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.TabPanel, {"headerTab":$get("__tab_TabContainer1_TabPanel2"),"ownerID":"TabContainer1"}, null, {"owner":"TabContainer1"}, $get("TabContainer1_TabPanel2"));
});
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.TabPanel, {"headerTab":$get("__tab_TabContainer1_TabPanel3"),"ownerID":"TabContainer1"}, null, {"owner":"TabContainer1"}, $get("TabContainer1_TabPanel3"));
});
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.TabContainer, {"activeTabIndex":0,"clientStateField":$get("TabContainer1_ClientState")}, null, null, $get("TabContainer1"));
});
//]]>
</script>
</form>

<!-- Visual Studio Browser Link -->
<script type="application/json" id="__browserLink_initializationData">
{"appName":"Internet Explorer","requestId":"147e791d45f246ad897d1236173b0408"}
</script>
<script type="text/javascript" src="http://localhost:52291/c7d32499a33a4d86925a3ae4ef0492d6/browserLink" async="async"></script>
<!-- End Browser Link -->

</body>
</html>

Modify request input filter stream in HTTP Module via filter

$
0
0

I want to modify the http request input filter stream in my HTTP Module via request filter. I am able to do as long as size of content is same or smaller. However if content size increases it start giving me exception. Is there anyone who has done the similar task. OR is it possible at all to modify/increase the size of request input stream in my HTTP Module via request filter

Gridview in tab does not update after delete, even when calling gv.update and up.update

$
0
0

I have a problem with a gridview that sits on a tabbed panel, which contains an update panel. The grid displays items a client has purchased in the past, it links to the clientID label on the form, but the primary key is the linenumber.

I use the builtin update and everything work well, I was using the built in Delete (i.e. I write no code but it gets called) but wanted to add a confirmation of delete and that stopped working, so I used rowcommand to do the delete, it deletes the data fine, but when I rebind the grid and update the panel it does not show on the screen, if I force a refresh of the page the gridview then shows the correct date.

Here is the HTML portion of the code:

<ajaxToolkit:TabContainer ID="tabcCustomer" runat="server" ActiveTabIndex="1" AutoPostBack="true" ><ajaxToolkit:TabPanel runat="server" HeaderText="Next Required" ID="tabpnlNextRequired"><HeaderTemplate>Next Items Required</HeaderTemplate><ContentTemplate><asp:UpdatePanel ID="upnlNextItems" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" ><ContentTemplate><div style="padding:4px">
             //... code in the first tab</div></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="btnForceNext"  EventName="Click" /></Triggers></asp:UpdatePanel></ContentTemplate></ajaxToolkit:TabPanel><ajaxToolkit:TabPanel runat="server" HeaderText="Items" ID="tabpnlItems"><HeaderTemplate>Customer Usage</HeaderTemplate><ContentTemplate><asp:UpdateProgress ID="updtprgItems" runat="server" AssociatedUpdatePanelID="upnlItems"><ProgressTemplate><img src="../images/animi/BlueArrowsUpdate.gif" alt="updating" width="16" height="16" />please wait.....</ProgressTemplate></asp:UpdateProgress><asp:UpdatePanel ID="upnlItems" runat="server" UpdateMode="Conditional" ><ContentTemplate><div class="simpleForm" style="padding: 4px"><div class="simpleLightGreenForm"><asp:GridView ID="gvItems" runat="server" AllowSorting="True" CssClass="TblWhite small" EmptyDataText="no data yet" 
                  AutoGenerateColumns="False" DataSourceID="odsItemUsage" AllowPaging="True" PagerSettings-Mode="NextPreviousFirstLast"
                  DataKeyNames="ClientUsageLineNo" OnRowCommand="gvItems_RowCommand" DataKey="ClientUsageLineNo"
                  PageSize="15" PagerSettings-FirstPageImageUrl="~/images/imgButtons/FirstPage.gif" 
                  PagerSettings-LastPageImageUrl="~/images/imgButtons/LastPage.gif" 
                  PagerSettings-NextPageImageUrl="~/images/imgButtons/NextPage.gif" PagerSettings-PreviousPageImageUrl="~/images/imgButtons/LastPage.gif" ><Columns><asp:TemplateField ShowHeader="False"><EditItemTemplate><asp:ImageButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" 
                                  AlternateText="Update" ImageUrl="~/images/imgButtons/UpdateItem.gif" />&nbsp;<asp:ImageButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                  AlternateText="Cancel" ImageUrl="~/images/imgButtons/CancelItem.gif" /></EditItemTemplate><ItemTemplate><asp:ImageButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" 
                                AlternateText="Edit" ImageUrl="~/images/imgButtons/EditItem.gif" />&nbsp;<asp:ImageButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                                AlternateText="Delete"  ImageUrl="~/images/imgButtons/DelItem.gif"
                                OnClientClick="return confirm('Are you sure you want to delete this item?');"
                                CommandArgument='<%# Eval("ClientUsageLineNo") %>' /></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Date" SortExpression="Date"><EditItemTemplate><asp:TextBox ID="tbxDate" runat="server" Text='<%# Bind("ItemDate", "{0:d}") %>'  /></EditItemTemplate><ItemTemplate><asp:Label ID="lblData" runat="server" Text='<%# Bind("ItemDate", "{0:d}") %>' /></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Item" ><EditItemTemplate><asp:DropDownList ID="ddlItems" runat="server" DataSourceID="odsItems" 
                          DataTextField="ItemDesc" DataValueField="ItemTypeID" AppendDataBoundItems="true"
                          SelectedValue='<%# Bind("ItemProvidedID") %>'><asp:ListItem Value="0" Text="n/a" /></asp:DropDownList></EditItemTemplate><ItemTemplate><asp:Label ID="ItemDescLabel" runat="server" Text='<%# GetItemDesc((int)Eval("ItemProvidedID")) %>' /></ItemTemplate></asp:TemplateField><asp:BoundField DataField="AmountProvided" HeaderText="Qty"
                      SortExpression="AmountProvided" /><asp:TemplateField HeaderText="Packaging" SortExpression="PackagingID"><EditItemTemplate><asp:DropDownList ID="ddlPackaging" runat="server" DataSourceID="odsPackagingTypes"
                          DataTextField="Description" DataValueField="PackagingID" AppendDataBoundItems="true"
                          SelectedValue = '<%# Bind("PackagingID") %>' ><asp:ListItem Value="0" Text="n/a" /></asp:DropDownList></EditItemTemplate><ItemTemplate><asp:Label ID="PackagingIDLabel" runat="server" Text='<%# GetPackagingDesc((int)Eval("PackagingID")) %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Prep Type" SortExpression="PrepTypeID"><EditItemTemplate><asp:TextBox ID="PrepTypeIDTextBox" runat="server" Text='<%# Bind("PrepTypeID") %>'></asp:TextBox></EditItemTemplate><ItemTemplate><asp:Label ID="PrepTypeIDLabel" runat="server" Text='<%# Bind("PrepTypeID") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:BoundField DataField="Notes" HeaderText="Notes" 
                      SortExpression="Notes" /><asp:BoundField DataField="CustomerID" Visible="False" /><asp:BoundField DataField="ClientUsageLineNo" Visible="False" /></Columns><PagerSettings FirstPageImageUrl="~/images/imgButtons/FirstPage.gif" LastPageImageUrl="~/images/imgButtons/LastPage.gif" Mode="NumericFirstLast" NextPageImageUrl="~/images/imgButtons/NextPage.gif" PreviousPageImageUrl="~/images/imgButtons/LastPage.gif" /></asp:GridView></div></div></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="gvItems" EventName="RowCommand" /></Triggers></asp:UpdatePanel></ContentTemplate></ajaxToolkit:TabPanel></ajaxToolkit:TabContainer><asp:ObjectDataSource ID="odsItemUsage" runat="server" TypeName="TrackerDotNet.control.ItemUsageTbl"
      SortParameterName="SortBy"
      SelectMethod="GetAllItemsUsed"
      OldValuesParameterFormatString="original_{0}" UpdateMethod="UpdateItemsUsed"  DeleteMethod="DeleteItemLine" ><DeleteParameters><asp:Parameter Name="ClientUsageLineNo" Type="Int64" /></DeleteParameters><SelectParameters><asp:ControlParameter ControlID="CompanyIDLabel" DefaultValue="0" 
          Name="pCustomerID" PropertyName="Text" Type="Int64" /><asp:Parameter DefaultValue="&quot;Date&quot;" Name="SortBy" Type="String"  /></SelectParameters><UpdateParameters><asp:Parameter Name="CustomerID" Type="Int64" /><asp:Parameter Name="ItemDate" Type="DateTime" /><asp:Parameter Name="ItemProvidedID" Type="Int32" /><asp:Parameter Name="AmountProvided" Type="Double" /><asp:Parameter Name="PrepTypeID" Type="Int32" /><asp:Parameter Name="PackagingID" Type="Int32" /><asp:Parameter Name="Notes" Type="String" /><asp:Parameter Name="original_ClientUsageLineNo" Type="Int64" /></UpdateParameters></asp:ObjectDataSource>

The the code behind for the rowcommand, it calls the objectdatasource directly using the keyfield and deletes the row then updates the grid and the updatepanel - but nothing happens, except the udpdateprogress shows for a while, showing the update event is triggered:

    protected void gvItems_RowCommand(object sender, GridViewCommandEventArgs e)
    {
      if (e.CommandName == "Delete")
      {
        ItemUsageTbl _ItemUsage = new ItemUsageTbl();
        _ItemUsage.ClientUsageLineNo = Convert.ToInt64(e.CommandArgument);
        _ItemUsage.DeleteItemLine(_ItemUsage.ClientUsageLineNo);

        gvItems.DataBind();
        upnlItems.Update();
      }
    }

Calling ModalPopupExtender from another User Control

$
0
0

I have three user controls. The controls are Window.ascx, Preview.ascx, Message.ascx. The Preview control displays in the Window's control iframe and the message displays on top of the preview.

When btnClose button in the message.ascx control is clicked, I need to close everything. How can it be done?

I tried registering Window.ascx in the Message.ascx then calling a public method from Window.ascx.cs with mpeNewWindowPopup.Hide(); But it did not work.

Any ideas?

Window.ascx

<asp:UpdatePanel runat="server" ID="udpNewWindow"><ContentTemplate><asp:Panel runat="server" ID="pnlNewWindowPopUp" Width="674" Height="500" style="display:none;"><asp:HiddenField runat="server" ID="hdfDummyNWPopup" /><div class="popup" style="padding: 0px 0px 10px 0px;"><div style="float:left; background-color: #069; width: 100%;"><div style="float: left; color: White; font-size: 17px; font-weight: bold; padding: 5px 0px 5px 5px;"><asp:Label runat="server" ID="lblTitle" /></div><div style="float:right;"><asp:ImageButton runat="server" ID="imgClose" ImageUrl="~/images/closeX.png" AlternateText="Close" ToolTip="Close" OnClick="imgClose_Click" />                        </div></div><br /><br /><div><iframe runat="server" id="ifrmWindow" scrolling="auto" height="480px" width="670px" frameborder="0" /></div></div>            </asp:Panel><asp:ModalPopupExtender ID="mpeNewWindowPopup" runat="server" PopupControlID="pnlNewWindowPopUp" BackgroundCssClass="modalBackground" RepositionMode="None" Y="30"
                                DynamicServicePath="" Enabled="True" TargetControlID="hdfDummyNWPopup" DropShadow="false" /></ContentTemplate></asp:UpdatePanel>

Preview.ascx

<body><form id="form1" runat="server"><center><asp:ToolkitScriptManager runat="server" ID="tsmPreview" /><asp:UpdatePanel runat="server" ID="udpPreview"><ContentTemplate><uct:Message runat="server" ID="ctrMessage" />                                       <div style="width: 100%; height: 30px; margin-top: 10px;"><asp:Button runat="server" ID="btnEdit" Text="Edit" OnClick="btnEdit_Click" /> <asp:Button runat="server" ID="btnPost" Text="Post" OnClick="btnPost_Click" />  </div></ContentTemplate></asp:UpdatePanel>          </center></form></body>

Message.ascx

<asp:UpdatePanel runat="server" ID="udpMessage">    <ContentTemplate>                       <asp:Panel runat="server" ID="pnlMessage" style="display:none;">                        <div class="popup" style="text-align:center;"><div style="padding:10px; border: solid 1px #aaa;"><asp:HiddenField runat="server" ID="hdfDummy" /><asp:Label runat="server" ID="lblMsg" Font-Size="12px" /><br /><br /><asp:Button runat="server" ID="btnClose" Text="OK" onclick="btnClose_Click" /></div></div></asp:Panel><asp:ModalPopupExtender ID="mpeMessage" runat="server" PopupControlID="pnlMessage" BackgroundCssClass="modalBackground"
                                DynamicServicePath="" Enabled="True" TargetControlID="hdfDummy" DropShadow="true" />        </ContentTemplate></asp:UpdatePanel>



Update and Delete event not working for the Gridview when put inside the Update Panel.

$
0
0

Hi Friends,

I have a Gridview with Update and Delete events. It was working fine before. When i tried to put the gridview inside the Update panel,both the events stopped working. I am new to Ajax controls, so don't have much idea how to solve this. Some one please help me,its really urgent for me. 

Below is my Source code.

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode ="Conditional" >
<ContentTemplate >

<asp:GridView ID="GvView" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" EnableModelValidation="True" GridLines="Horizontal" CssClass="mGrid" Width="1300px" Height="160px" DataKeyNames="DataEntryCode" PageSize="20">
<AlternatingRowStyle BackColor="#F7F7F7" />

<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="btnUpdate" runat="server" CausesValidation="True" CommandName="Update" Font-Size="Small" Text="Update"></asp:LinkButton> &nbsp;<br />
<asp:LinkButton ID="LinkButton21" runat="server" CausesValidation="False" CommandName="Cancel" Font-Size="Small" Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" CommandName="Edit" Font-Size="Small" Text="Edit"></asp:LinkButton>
</ItemTemplate>
<ControlStyle Width="50px" />
<HeaderStyle HorizontalAlign="Center" Width="50px" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>

<asp:CommandField ShowDeleteButton="True">
<ControlStyle Font-Size="Small" Width="50px" />
<ItemStyle HorizontalAlign="Center" />
</asp:CommandField>


<asp:TemplateField HeaderText="Data Entry Code" Visible="False">
<EditItemTemplate>
<asp:TextBox ID="txtDataEntryCode_edit" runat="server" Text='<%# Bind("DataEntryCode") %>' CssClass="txtbox" Font-Size="Small" style="height: 16px" Width="90px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblDataEntryCode" Text='<%# Bind("DataEntryCode") %>' runat="server" Font-Size="Small" Width="60px"></asp:Label>
</ItemTemplate>
<ControlStyle Width="90px" />
<HeaderStyle Font-Size="Small" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle Font-Size="Small" />
</asp:TemplateField>

<asp:TemplateField HeaderText="Today's Progress">
<EditItemTemplate>
<asp:TextBox ID="txtTodaysProgress_edit" runat="server" Text='<%# Eval("TodaysProgress") %>' CssClass="txtbox" Font-Size="Small" style="height: 16px" Width="80px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lbTodaysProgress" runat="server" Text='<%# Eval("TodaysProgress") %>' Font-Size="Small" Width="80px"></asp:Label>
</ItemTemplate>
<ControlStyle Width="80px" />
<HeaderStyle Font-Size="Small" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle Font-Size="Small" />
</asp:TemplateField>

<asp:TemplateField HeaderText="Total Installed Qty">
<EditItemTemplate>
<asp:TextBox ID="txtTotalInstalledQty_edit" runat="server" Text='<%# Eval("TotalInstalledQty") %>' CssClass="txtbox" Font-Size="Small" style="height: 16px" Width="80px" Enabled="False"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalInstalledQty" runat="server" Text='<%# Eval("TotalInstalledQty") %>' Font-Size="Small" Width="80px"></asp:Label>
</ItemTemplate>
<ControlStyle Width="80px" />
<HeaderStyle Font-Size="Small" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle Font-Size="Small" />
</asp:TemplateField>

</Columns>
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
</asp:GridView>

</ContentTemplate>
</asp:UpdatePanel>

Also i need to work a textchanged event for a textbox inside the gridview txtTodaysProgress_edit. In the edit mode, when i enter a value in this textbox,it should get added to the existing value in the next textboxtxtTotalInstalledQty_edit and the sum should be displayed in the next textbox txtTotalInstalledQty_edit.

Hope someone will help me soon.

Thanks.

show modalpopupextendar when button click inside the listview

$
0
0

I have a Databound Listview in which there are some fields and a button id="button1". There is modalpopupextender outside the listview. I wanted to show the popup when button1 is clicked. The Problem is TargetControlID="Button1" for ModalPopupExtender is not recognized outside the listview. Please suggest.

using updatepanel and enabling texbox if ispostback

$
0
0

Hi. I have only a TextBox and a DropDownlist on aspx-file. TextBox enabled property is false by default. Texbox is in the UpdatePanel. And also I'm using MasterPage, but TextBox and DropDownlist aren't on the MasterPage. 

 protected void Page_Load(object sender, EventArgs e)
    {

        if (IsPostBack && DropDownList1.SelectedIndex != 0)
        {
            tbAuto.Enabled = true;
            Button2.Enabled = true;
        }



    }

Using this code. I'm not only getting a textbox with enabled true, but also the same textbox with enabled false which was by default.

How to solve it?

Can you please also explain me, why is it so? 


AutoCompleteExtender question

$
0
0

I have a text box with an AutoCompleteExtender attached. I am trying to use data returned from a stored procedure as the data source for a web service that worked with the extender when I used a select statement instead of the SPROC. Initially the select simply looked for users names and the extender worked properly. However,  I want to  be able to type in a   name, city, or statename and have the extender display results for all three. Example:

PROCEDURE [dbo].[multisearch] 

	@item varchar(50)
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	AS
	BEGIN

	SET NOCOUNT ON;

	declare @srchitem table(
	item varchar(50)
)

Insert into @srchitem 
select fname +' ' + lname

from riders

Insert into @srchitem
select distinct  city
from address


Insert into @srchitem
select distinct  statename
from state

 Select * from @srchitem where item like @item +'%'
END


The stored procedure is fairly simple. If I execute the procedure in the SQL Management studio like

EXEC multisearch 'ken' I get a bunch of Kens and Kenneths and the state Kentucky so I think that the SQL is OKAY.

but when I try to execute from the app  (debugging) it stops before it finishes the code:

[WebMethod]
public List<string> GetItems(string prefixText)
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["BDUCConnectionstring"].ToString());
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "[multisearch]";
//SqlCommand cmd = new SqlCommand("select riderid, dname from riders where dname like @name+'%'", con);
cmd.Parameters.AddWithValue("@item", prefixText);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
int cnt = dt.Rows.Count;
List<string> items = new List<string>();

    for (int i = 0; i < dt.Rows.Count; i++)
{
    items.Add(dt.Rows[i][0].ToString());
    items.Add(dt.Rows[i][1].ToString());
 //Names.Add(dt.Rows[i][0].ToString());
  string sid = dt.Rows[i][0].ToString();

    
}
    return items;
} }
When the code hits the ine 'da.Fill(dt);'
it stops running and the last part of the code never runs.There are no errors it just quits. Here is the ASPX:
<asp:TextBox ID="tbSearch" runat="server" OnTextChanged="tbSearch_TextChanged" /><ajaxToolkit:AutoCompleteExtender ID="txtfind_AutoCompleteExtender" runat="server" MinimumPrefixLength="2" EnableCaching="true" 
                    CompletionSetCount="1" CompletionInterval="1000"  ServicePath="~/Mutts/WebService.asmx" 
                    Enabled="True" ServiceMethod="GetItems" TargetControlID="tbSearch"></ajaxToolkit:AutoCompleteExtender>
Anyone know what the problem is?

MaskedEditExtender error

$
0
0

Hi.

I have this code

<asp:MaskedEditExtender runat="server" TargetControlID="tb_time" ID="meeHoraChegada"
     MaskType="Time" Mask="99:99" AutoComplete="false"></asp:MaskedEditExtender><asp:MaskedEditValidator ID="MaskedEditValidator2"  runat="server"
     ControlExtender="meeHoraChegada" ControlToValidate="tb_time"
     IsValidEmpty="True"
     InvalidValueMessage="The Time is not valid!"> </asp:MaskedEditValidator> 

When i start to enter the time, where i press a key it fill's the hour with the twice os the key value and in the next key press i get the same number twice.

For example i press 1 the hour stays with 11 and where i press the second digit value 3 i get 33 the result will be 11:33....

if i press 2 and 5 i get 22:55...

Any idea?

Can't find "AJAX Control Tookit" in Toolbox

$
0
0

I have installed AJAX Control Toolkit from here: https://go.devexpress.com/AjaxControlToolkit_Website_Download.aspx

BUT, I can't find it in the Toolbox. I have looked at this page: https://ajaxcontroltoolkit.codeplex.com/wikipage?title=Step-by-Step%20Installation%20Guide&referringTitle=Documentation

The instructions says:

1) After the installation is over, create new ASP.NET Web Forms project in Visual Studio
2) To show the AJAX Control Toolkit controls in the Toolbox select any .aspx page in the Solution Explorer

BUT, my toolbox still looks the same. I don't find anything like "AJAX Control Toolkit v15.1".

When searching for the issue, there always the same suggestions of creating "AJAX Control Toolkit" in the toolbox manually and then find  some "AJAXControlToolkit.dll". I have searched for this file and can't find it. Still I have "AJAX Control Toolkit" installed.

I don't know why finding this "AJAXControlToolkit.dll" is constantly suggested, because it doesn't seems to be the official way of doing things. When looking at the step-by-step guide there isn't any line mention searching for any dll, so I don't know why this (misleading information) is suggested by others. I'm sure that if finding some dll was the way to go, then it would have been suggested in the step-by-step guide.

So does anyone have any REAL suggestions on how to get the "AJAX Control Toolkit" in the Toolbox?
As I understand, not every version have support for Toolbox integration, but I'm using Visual Studio Community 2015, so I should be good to go.

How do i use model popup to display server side message on data submission

$
0
0

How do i use model popup to display server side message on data submission, example if a user wants to submit record to database , how do i use model popup to display "Data submitted successfully!", instead of using window popup like this:

                                                                                }
                                                                                else
                                                                                {
                                                                                    ScriptManager.RegisterClientScriptBlock(btnSave, this.GetType(), "alert", "<script>alert('Please quantity required is more than the stock, Stock is 1 or less than 1, update stock ... !!')</script>", false);
                                                                                }
                                                                            }

ASP.NET Web Site + Ajax Control ToolKit 4.0+ Entity Framework - unhandled exception in Windows Server 2008 R2 with 4.5 runtime

$
0
0

Hi,

We have created an ASP.Net website with Entity Framework and Ajax control toolkit 4.0. We have used VS 2010 and application is targeting .NET 4.0 runtime. The application is deployed in Windows Server 2008 R2. Application is using Windows Authentication.

Application is running fine in production environment but giving error in lower environments as following:

--------------------------------------------------------------------------------------------

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 8/12/2015 4:50:34 PM
Event time (UTC): 8/12/2015 7:50:34 AM
Event ID: a7f99008818b4018a919ff5185f39b13
Event sequence: 54
Event occurrence: 1
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT/MyApp-1-130838392697680857
    Trust level: Full
    Application Virtual Path: /MyApp
    Application Path: D:\L3\MyApp\
    Machine name: <Server Name>
 
Process information:
    Process ID: 8604
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
 
Exception information:
    Exception type: NullReferenceException
    Exception message: Object reference not set to an instance of an object.
   at MyApp.MyRepository.Dispose(Boolean disposing) in C:\Users\Admin\Desktop\Projects\MyApp\Repository\MyRepository.cs:line 274
   at MyApp.Business.RequestManager.Dispose(Boolean disposing) in C:\Users\Admin\Desktop\Projects\MyApp\Business\RequestManager.cs:line 366
   at MyApp.Presentation.RequestPresenter.Dispose(Boolean disposing) in C:\Users\Admin\Desktop\Projects\MyApp\Presentation\Presenters\RequestPresenter.cs:line 83
   at MyApp.Web.ViewDetails.btnSubmit_Click(Object sender, EventArgs e) in C:\Users\Admin\Desktop\Projects\MyApp\MyApp.Web\ViewDetails.aspx.cs:line 657
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 
 
Request information:
    Request URL: http://localhost/MyApp/ViewDetails.aspx
    Request path: /MyApp/MyApp.Web/ViewDetails.aspx
    User host address: <hostip>
    User: Test
    Is authenticated: True
    Authentication Type: NTLM
    Thread account name: NT AUTHORITY\NETWORK SERVICE
 
Thread information:
    Thread ID: 9
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    <StackTrace details>
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
 
Custom event details:
--------------------------------------------------------

In production, .Net framework 4.0 runtime, .Net 4.0 client profile and IIS 7.5 is installed where in lower environments VS2013 with 4.5 runtime, client profile and IIS 8.0 is installed.

We are not getting any error while receiving data from server and displaying in Ajax datagrid, but submitting data from ajax data grid is not working and resulting into above error.

I have already tried using aspnet_regiis to give access to physical path of virtual directory to IIS_IUSRS group, but it did not resolve the issue.

Please help me on this.

ModalPopup Extender

$
0
0

Dear *.*

i have a modalpopup extender with gridview control that show's record, a textbox control (use for search key) and a button control.

this is my problem, when i input a value on a textbox and then clicked the button search, the modalpopup extender close...

it should show the results on a gridview control....

anybody help?

Ajax control toolkit modalpopup black background issue

$
0
0

Hi
       I am learning using ajax control toolkit and I am trying to use Ajax control toolkit modal popup extender in one of my website. Modal popup is working fine however I am not able to get black background when modal popup is opened.

Here is my code:

<asp:LinkButton ID="LinkButton11" runat="server">Open Pop up</asp:LinkButton>

        <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="PnlPopup" TargetControlID="LinkButton11" CancelControlID="LinkButton12" />
        <asp:Panel ID="PnlPopup" runat="server" CssClass="message">
            <h3>It Popped Up Here is modal popup</h3>

            <asp:LinkButton ID="LinkButton12" runat="server">Close</asp:LinkButton>
        </asp:Panel>


Modal popup strange display behaviour on post back

$
0
0

While using Ajax control toolkit in my website and I have created Ajax control toolkit modal popup extender in my page.
Every thing is working fine but when I am pressing any button on page or selecting any dropdownlist page reloads and it shows My modal popup extender for few seconds. It disappears when page is completely reloads.

How to solve this issue?

Cascading dropdownlists in Accordion and tabs not working

$
0
0

I have created a JQuery accordion of which I’m trying to implement a Cascading DropDownList (4 DropDowns).

The initial dropdown is bound to a stored procedure in the Page_Load event. This populates and works fine.

The other 3 dropdowns are also connected through stored procedures and are placed in their own SelectedIndexChanged events. The first dropdownlist (Page_Load event) also has a separate SelectedIndexChanged event. None of these seem to actually be firing.

When I execute the stored procedures in MSSQL Management Studio they all output the correct result. However one thing I need to mention is the ID for each of the stored procedures is a varchar.

This is from an old, non-relational, single distinct table in a database and not how I would have done it. But it holds too much data to correct.  

I've cut the code down as there far too much for these pages

<asp:ScriptManager ID="AccordionScriptManager" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="UpAccordionSearch" runat="server" ChildrenAsTriggers="false"
        UpdateMode="Conditional"><ContentTemplate><div id="tabs-4"><div class="Table"><div class="Row"><div class="Cell">
                                                One:</div><div class="Cell"><asp:DropDownList ID="ddl1l" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl1_SelectedIndexChanged" /></div></div><div class="Row"><div class="Cell">
                                                Two:</div><div class="Cell"><asp:DropDownList ID="ddl2" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl2_SelectedIndexChanged" /></asp:DropDownList></div></div><div class="Row"><div class="Cell">
                                                Three:</div><div class="Cell"><asp:DropDownList ID="ddl3" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl3_SelectedIndexChanged"  /></div></div><div class="Row"><div class="Cell">
                                                Four:</div><div class="Cell"><asp:DropDownList ID="ddl4" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl4_SelectedIndexChanged" /></div></div><div class="Row"><div class="Cell"></div><div class="Cell"><div class="Row"><div class="Cell"><asp:Button runat="server" ID="btn_Reset " Text="Reset" OnClientClick="this.form.reset();return false;" /></div><div class="Cell"><asp:Button ID="btnAccordion" runat="server" Text="Search" OnClick="btn_Click" /></div></div></div></div></div></div></div></div></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="btnAccordion" EventName="click" /></Triggers></asp:UpdatePanel>
Protected Sub ddl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

        Try
            Using con As New SqlConnection(ConfigurationManager.ConnectionStrings("MyConn").ConnectionString)
                Using cmd As New SqlCommand()
                    cmd.CommandType = CommandType.StoredProcedure
                    cmd.CommandText = "sp_1"
                    cmd.Parameters.AddWithValue("@one", ddl1.SelectedItem.ToString())
                    cmd.Connection = con
                    con.Open()
                    Dim da As New SqlDataAdapter(cmd)
                    Dim dt As New DataTable()
                    da.Fill(dt)
                    ddl2.DataSource = dt
                    ddl2.DataValueField = "Code2"
                    ddl2.DataTextField = "Name2"
                    ddl2.DataBind()
                    con.Close()

ddl2.Items.Insert(0, New ListItem("Please select Name2", "0"))

                    
                    ddl3.Items.Clear()
                    ddl3.Items.Insert(0, New ListItem("Please select Name3", "0"))
                End Using
            End Using
        Catch
        End Try


    End Sub

    Protected Sub ddl2_SelectedIndexChanged(sender As Object, e As EventArgs)

        Try
            Using con As New SqlConnection(ConfigurationManager.ConnectionStrings("MyConn").ConnectionString)
                Using cmd As New SqlCommand()
                    cmd.CommandType = CommandType.StoredProcedure
                    cmd.CommandText = "sp_2"
                    cmd.Parameters.AddWithValue("@two", ddl2.SelectedValue.ToString())
                    cmd.Connection = con
                    con.Open()
                    Dim da As New SqlDataAdapter(cmd)
                    Dim dt As New DataTable()
                    da.Fill(dt)


                    ddl3.DataSource = dt
                    ddl3.DataTextField = "Name3"
                    ddl3.DataValueField = "Code3"
                    ddl3.DataBind()
                    con.Close()
                    ddl3.Items.Insert(0, New ListItem("--Select--", "0"))

                    If ddl3.SelectedValue = "0" Then
                        Ddl3.Items.Clear()
                        Ddl3.Items.Insert(0, New ListItem("--Select--", "0"))
                    End If


                End Using
            End Using
        Catch
        End Try


    End Sub

    Protected Sub ddl3_SelectedIndexChanged(sender As Object, e As EventArgs)


        Try
            Using con As New SqlConnection(ConfigurationManager.ConnectionStrings("MyConn").ConnectionString)
                con.Open()
                Using cmd As New SqlCommand()

                    cmd.CommandType = CommandType.StoredProcedure
                    cmd.CommandText = "sp_3"
                    cmd.Parameters.AddWithValue("@three", ddl3.SelectedItem.Value)
                    cmd.Connection = con

                    Dim da As New SqlDataAdapter(cmd)
                    Dim ds As New DataSet()
                    da.Fill(ds)

                    con.Close()
                    ddl4.DataSource = ds
                    ddl4.DataTextField = "Name4"
                    ddl4.DataValueField = "code4"
                    ddl4.DataBind()


                End Using
            End Using
        Catch
        End Try
    End Sub


Dynamically showing/hiding tabcontainers -vb.net

$
0
0

Hi

I have 2 gridviews inside a tabcontainer.

On page load i want to hide the tabcontainer and only show it after the user clicks a button and if the Dataset isn't empty.

However, I get the error below. If I show the tabcontainer at all times there is no error.

I read somewhere to maybe hide the tr instead but when i add runat=server to tr and give it id it's not recognised in codebehine.

Sys.InvalidOperationException: Could not find UpdatePanel with ID 'TabContainer1_TabPanelGeneral_upMaslulim'. If it is being updated dynamically then it must be inside another UpdatePanel.

<tr  ><td style="height: 105px" ><asp:UpdatePanel ID="Panel1" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" CssClass="ajax__tab_yuitabview-theme"><asp:TabPanel ID="TabPanelGeneral" runat="server" HeaderText=" Generic" ><ContentTemplate><asp:UpdatePanel ID="upMaslulim" runat="server" UpdateMode="Conditional"><ContentTemplate><table><tr id="trMaslulHeader" runat="server"><td>
                                                                                       Generic </b> <asp:HiddenField ID="hdnGridCompany" runat="server" /><asp:HiddenField ID="hdnKerenID" runat="server" /><asp:HiddenField ID="hdnGridKranot" runat="server" /></td></tr><tr ><td><div id="divMaslulim" runat="server" class="divScroll"><asp:GridView runat="server" ID="grdMaslulim" CssClass="GridStyle1" Width="98%" AlternatingRowStyle-CssClass="GridStyle1_Alt"
                                                                    RowStyle-CssClass="GridStyle1_Row" SelectedRowStyle-CssClass="GridStyle1_Selected">
------omitted for brevity</asp:GridView></div></td></tr></table></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="cmdSearch" EventName="Click" /></Triggers></asp:UpdatePanel></ContentTemplate></asp:TabPanel><asp:TabPanel ID="TabPanelInvestment" runat="server" HeaderText="Inverstment"><ContentTemplate><asp:UpdatePanel ID="upInvestment" runat="server" UpdateMode="Conditional"><ContentTemplate><table><tr id="trInvestmentHeader" runat="server"><td></td></tr><tr><td><div id="divInvestment" runat="server" class="divScroll"><asp:GridView ID="grdInvestment">
--- omitted for brevity</asp:GridView></div></td></tr><tr><td><asp:UpdatePanel ID="UpInsertInvestment" runat="server" UpdateMode="Conditional"><ContentTemplate><table><tr id="trInsertInvestment" runat="server"><td>
                                                                                Add investment</td></tr><tr><td><asp:GridView ID="grdInsertInvestment" runat="server" AutoGenerateColumns="False"
                                                                                    --omitted for brevity</asp:GridView></td></tr></table></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="cmdSearch" EventName="Click" /></Triggers></asp:UpdatePanel></tr></table></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="cmdSearch" EventName="Click" /></Triggers></asp:UpdatePanel></ContentTemplate></asp:TabPanel></asp:TabContainer></ContentTemplate></asp:UpdatePanel></td></tr>

Close Modalpopup when clicked outside the page.

Reset gridview

$
0
0

Hi,

I have a webform with gridview  inside an updatepanel. I have a reset button that is placed also inside another updatepanel.

If the gridview is in edit mode and user clicks reset button and then the search button again then the gridview is shown in the state it was when reset button was clicked.

I need the gridview to be in the normal state without any row in edit mode.

In the reset button I have upGrid.Update() //upgrid is the id of the grid's updatepanel.

What am i doing wrong?

Thanks

Viewing all 5678 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>