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

AJAX Calendar Partial Display

$
0
0

I am having a problem with a AJAX Calendar partially blocked by a CKEditor toolbar, please see the attached image and code.  Please see the included screenshot and code.  Even adjusting compatibility settings hasn't helped but the issue is only with IE 8 - 11.

Any suggestions or recommendations would be most appreciated.

Thank you in advance.

Code:

<ajaxToolkit:CalendarExtender id="CalendarExtender1" runat="server" TargetControlID="DateBox" PopupButtonID="Image1"></ajaxToolkit:CalendarExtender><CKEditor:CKEditorControl ID="CKEditor1" BasePath="~/ckeditor/" runat="server" Visible="false"></CKEditor:CKEditorControl>


NumericUpDownExtender loses state when exit from ModalPopupExtender on page postback

$
0
0

Inside my modal popup I have a Numeric Extender attached a textbox. Here I set the value and close modal, on return

I proceed to process data by performing a page postback . The textbox value no longer exists in code behind page ?

 

Label Text Not Changing

$
0
0

I have a label in a popupmodal that doesn't want to change. It does on my other pages in the same project.

<asp:Panel ID="Panel10" runat="server"><asp:Button ID="DummyButton" runat="server" Style="display: none" /><asp:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" 
                                BackgroundCssClass="ModalBackgroud" CancelControlID="OKButton" Drag="True" 
                                DropShadow="True" DynamicServicePath="" Enabled="True" 
                                PopupControlID="pnlPopupWindow" TargetControlID="DummyButton"></asp:ModalPopupExtender><asp:Panel ID="pnlPopupWindow" runat="server" BorderStyle="None" 
                                CssClass="modalPopup"><asp:Panel ID="TitlePanel" runat="server" BackColor="White" 
                                    HorizontalAlign="Center" Width="100%"><asp:Image ID="TitlePanelImage" runat="server" Height="24" ImageAlign="Bottom" 
                                        ImageUrl="~/Images/info-icon.png" Width="24" /><asp:Label ID="lbTitlePanel" runat="server" Font-Bold="True" Font-Size="Large" 
                                        Font-Underline="False" Text="New Establishment"></asp:Label></asp:Panel><br /><asp:Label ID="lblMessage" runat="server"></asp:Label><asp:Panel ID="Panel3" runat="server" HorizontalAlign="Center"><br /><asp:Button ID="OKButton" runat="server" Text="OK" /></asp:Panel></asp:Panel></asp:Panel>

Code behind:

Dim message As String = "Please contact your agent or their supervisor at..." & vbCrLf  

lblMessage.Text = message         
Button1_ModalPopupExtender.Show()

 

Modal Popup Hide from Async Callback

$
0
0

I have a aspx page that calls a long-ish running piece of code.  My intent was to launch a modal popup with some verbiage or a hourglass-ish animation.  Once the long running piece of code finished, the popup would close.  Well... I can't get it to work.

Here is a dummy page that demonstrates the issue:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication4.WebForm1" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title><link href="StyleSheet1.css" rel="stylesheet" /></head><body><form id="form1" runat="server"><asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager><div><div style="width:500px;margin-left:auto;margin-right:auto;height:300px;background-color:#f5f5f5;text-align:center;"><h1>This is my neat div</h1><p><asp:Button ID="btnPopup" runat="server" Text="Pop" OnClick="btnPopup_Click" /></p></div></div><!--------------------------------------------------><button id="trgButton" runat="server" style="visibility: hidden;" /><asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="popupBackground" TargetControlID="trgButton" PopupControlID="popup" ></asp:ModalPopupExtender><asp:Panel ID="popup" runat="server" CssClass="popup"><p>whoo hoo i'm a popup</p></asp:Panel></form></body></html>

And here is the codebehind

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Threading;
using System.Runtime.Remoting.Messaging;
using System.Diagnostics;

namespace WebApplication4
{
    public partial class WebForm1 : System.Web.UI.Page
    {

        public delegate void ShowPopupDelegate();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnPopup_Click(object sender, EventArgs e)
        {
            ShowPopupDelegate s = new ShowPopupDelegate(ShowPopup);
            s.BeginInvoke(new AsyncCallback(PopupComplete), s);
            ModalPopupExtender1.Show();
        }

        private void ShowPopup()
        {
            for (int i = 1; i <= 10; i++)
            {
                Debug.WriteLine(Convert.ToString(i));
                Thread.Sleep(1000);
            }
        }

        private void PopupComplete(IAsyncResult ar)
        {
            Debug.WriteLine("Closing the popup");
            ModalPopupExtender1.Hide();

        }

    }
}

The popup shows just fine, and the callback PopupComplete runs and the code processes, but the popup never closes.

how to ModalPopExtender onOkScript run c# code?

$
0
0

Hi,

 I need to ModalPopExtender onOkScript run c# code.

plz help me, THANKS

Update Panel Problem in AJAX with drop down list control on selected index change

$
0
0

Hi...

This is demo app. Please download it. Follow the below link

http://www.fileswap.com/dl/Q9RBjolTzQ/

Its has so many js and css file, so can't paste all here. Please download from above.

I have a dropdown list control which is applied with css style. Its works fine without update panel.

When i place the dropdown list inside update panel to avoid postback, it is not working.

Please let me know whats the problem here?

Ajax not working with MasterPage

$
0
0

Hi,

I have a problem with Ajax which does not work in a master page.

I've added 2 image buttons to a master page and by ckicking them the content page changes.

The problem is that the entier page is refreshing and not just the UpdatePanel control.

This is the code I'm using:

<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"><ContentTemplate><asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="Applications"/><asp:AsyncPostBackTrigger ControlID="Queries"/></Triggers></asp:UpdatePanel>
protected void pageRedirect(object sender, ImageClickEventArgs e)
        {
            string PostBackControlID = getPostBackControlName().ToString();//find the control which is responsible for the postback
            switch (PostBackControlID)
            {
                case "Applications"://STATUS = NEW (1)
                    Response.Redirect("DMS_Apps.aspx");
                    break;
                case "Queries":
                    Response.Redirect("Queries.aspx");
                    break;
            }
        }

I assume it's the Response.Redirect command which is causing the problem.
Can anyone help me with a solution on how to solve this?

Thanks

how to get describe Ajax Slideshow to navigation?

$
0
0

Hi,

I created ajax slide show with database and now want to get describe to navigate but when I want to do this 

Here is code

<a href='reader.aspx?Test=<%# Eval(Decribe.Text) %>'><asp:Label ID="Decribe" runat="server"/></a>

navigate to page reader but quieystring is null

http://localhost:20608/reader.aspx?News=

I cant get Describe how to get that?

plz help me THANKS,


Modal PopUpExtender button doesn't fire back to the server

$
0
0

Hi,

Any idea why clicking the "ButtonCancelOK" button in the following code doesn't fire back to the server?

<asp:Panel ID="cancelConfirmation" align="center" CssClass="ModalWindow" style = "display:none" runat="server"><div class="popup_header">
                            Validation Message</div><div class="popup_Body">
                            Are you sure you want to CANCEL the changes?</div><div class="popup_Buttons"><asp:Button ID="ButtonCancelOkay" runat="server" Text="Okay" onclick="ValidationOK_Click"/><asp:Button ID="ButtonCancelCancel" runat="server" Text="Cancel" /></div></asp:Panel><ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
                        TargetControlID="cancel_edit" OkControlID="ButtonCancelOkay" CancelControlID="ButtonCancelCancel" 
PopupControlID="cancelConfirmation" DropShadow="true" BackgroundCssClass="modalBackground"><Animations><OnShown><FadeIn Duration=".4" Fps="20" /> </OnShown></Animations></ajaxToolkit:ModalPopupExtender>

HoverMenuExtender on page using ModalPopupExtender PostBackIssue

$
0
0

I have a page that has a simple hovermenu extending a panel with a radiobuttonlist on it (just used to toggle a setting).  The problem is that the page also implements a modalpopup that displays the results of a search.  If I click on an item in the popup, everything works fine (popup closes, code runs, page posts back).  The problem is, after the postback caused by the popup, the hovermenu panel becomes stuck visible.

Code is below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="DirectorySpyWebEdition._default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="X-UA-Compatible" content="IE=Edge" /><title>DirectorySpy: Web Edition</title><link href="Style.css" rel="stylesheet" type="text/css" /></head><body><form id="form1" runat="server"><asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager><div id="header"><h2>DirectorySpy</h2></div><div id="search"><asp:Label ID="lblSearch" runat="server" Text="Search:" CssClass="lblSearch"></asp:Label><asp:TextBox ID="txtSearch" runat="server" CssClass="txtSearch" BorderStyle="Solid" Font-Bold="True" Font-Size="X-Large"></asp:TextBox><asp:ImageButton ID="imgBtnSearch" runat="server" ImageUrl="~/Images/Search-icon3.png" CssClass="imgBtn" OnClick="imgBtnSearch_Click" /></div><div id="domainSelector"><asp:Button ID="btnDomain" runat="server" CssClass="btnDomain" Text="Domain &#9650;" /><asp:UpdatePanel ID="updPanelDomain" runat="server" UpdateMode="Always"><ContentTemplate><asp:Panel ID="pnlDomain" runat="server"><asp:RadioButtonList ID="rbListDomain" runat="server" CssClass="rbListDomain" ><asp:ListItem Selected="True">Domain1.COM</asp:ListItem><asp:ListItem>Domain2.COM</asp:ListItem></asp:RadioButtonList></asp:Panel></ContentTemplate></asp:UpdatePanel><br /><asp:HoverMenuExtender ID="HoverMenuExtender1" runat="server" PopDelay="30" PopupControlID="pnlDomain" PopupPosition="Bottom" TargetControlID="btnDomain"></asp:HoverMenuExtender></div><div id="content"><table align="center"><tr><td><asp:UpdatePanel ID="updPanelGeneralTab" runat="server" UpdateMode="Always" Visible="true"><ContentTemplate><asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" Width="100%"><asp:TabPanel ID="tabGeneral" runat="server" HeaderText="General"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvGeneralTab" runat="server" CssClass="grid" AutoGenerateColumns="False" ShowHeader="False"><Columns><asp:BoundField DataField="attribute"><ItemStyle Width="150px" Font-Bold="True" /></asp:BoundField><asp:TemplateField HeaderText="value"><ItemTemplate><asp:Label ID="Label22" runat="server" Text='<%# Bind("value") %>'></asp:Label></ItemTemplate></asp:TemplateField></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabAddress" runat="server" HeaderText="Address"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvAddressTab" runat="server" CssClass="grid" AutoGenerateColumns="False" ShowHeader="False"><Columns><asp:BoundField DataField="attribute"><ItemStyle Width="150px" Font-Bold="true" /></asp:BoundField><asp:TemplateField HeaderText="value"><ItemTemplate><asp:Label ID="Label23" runat="server" Text='<%# Bind("value") %>'></asp:Label></ItemTemplate></asp:TemplateField></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabObjectInfo" runat="server" HeaderText="Object Info"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvObjectInfoTab" runat="server" CssClass="grid" AutoGenerateColumns="False" ShowHeader="False"><Columns><asp:BoundField DataField="attribute"><ItemStyle Width="150px" Font-Bold="true" /></asp:BoundField><asp:TemplateField HeaderText="value"><ItemTemplate><asp:Label ID="Label24" runat="server" Text='<%# Bind("value") %>'></asp:Label></ItemTemplate></asp:TemplateField></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabExchange" runat="server" HeaderText="Exchange"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvExchangeTab" runat="server" CssClass="grid" AutoGenerateColumns="False" ShowHeader="False"><Columns><asp:BoundField DataField="attribute"><ItemStyle Width="150px" Font-Bold="true" /></asp:BoundField><asp:TemplateField HeaderText="value"><ItemTemplate><asp:Label ID="Label24" runat="server" Text='<%# Bind("value") %>'></asp:Label></ItemTemplate></asp:TemplateField></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabProxyAddresses" runat="server" HeaderText="Proxy Addresses"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvProxyAddressesTab" runat="server" AutoGenerateColumns="False" CssClass="grid" ShowHeader="False"><Columns><asp:BoundField DataField="proxyAddress" /></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabRestrictions" runat="server" HeaderText="Restrictions"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvRestrictionsTab" runat="server" AutoGenerateColumns="False" CssClass="grid" ShowHeader="False"><Columns><asp:BoundField DataField="authOrig" /></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabMembers" runat="server" HeaderText="Members"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvMembersTab" runat="server" AutoGenerateColumns="False" CssClass="grid" ShowHeader="False"><Columns><asp:BoundField DataField="member" /></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabMemberOf" runat="server" HeaderText="Member Of"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvMemberOfTab" runat="server" AutoGenerateColumns="False" CssClass="grid" ShowHeader="False"><Columns><asp:BoundField DataField="memberOf" /></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabManagerOf" runat="server" HeaderText="Manager Of"><ContentTemplate><table class="tabTable"><tr><td><asp:GridView ID="gvManagerOfTab" runat="server" AutoGenerateColumns="False" CssClass="grid" ShowHeader="False"><Columns><asp:BoundField DataField="managedObjects" /></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:TabPanel><asp:TabPanel ID="tabPhoto" runat="server" HeaderText="Photo"><ContentTemplate><table class="tabTable"><tr><td align="center"><asp:Image ID="thumbnailPhoto" runat="server" ImageUrl="~/Images/sil_med.png" /></td></tr></table></ContentTemplate></asp:TabPanel></asp:TabContainer></ContentTemplate></asp:UpdatePanel></td></tr></table></div><div id="footer"></div><!-- Search Popup --><asp:Button ID="popupSearchTargetControl" runat="server" Style="display: none" /><asp:ModalPopupExtender ID="popupSearch" runat="server" BackgroundCssClass="modalBackground" TargetControlID="popupSearchTargetControl" PopupControlID="pnlPopupSearch" BehaviorID="bPopupSearch"></asp:ModalPopupExtender><asp:Panel ID="pnlPopupSearch" runat="server" CssClass="popupSearch"><asp:UpdatePanel ID="updPanelPopupSearch" runat="server" UpdateMode="Conditional"><ContentTemplate><table id="tblPopupSearchHeader" align="center" cellpadding="0" cellspacing="0" width="100%"><tr><td style="border-bottom: solid; border-width: 3px; background-color: #c8332e; color: white; font-family: 'Cordia New'; border-bottom-color: black;" align="left"><div style="padding-left: 10px; font: bold; font-size: large;">
                                    Search Results:<asp:Label ID="lblPopupSearchHeader" runat="server"></asp:Label></div></td><td align="right" style="background-color: #c8332e; color: white; border-bottom: solid; border-bottom-color: black; border-width: 3px; vertical-align: bottom;"><asp:Button ID="Button2" runat="server" BackColor="Black" BorderStyle="None" ForeColor="White" Height="25px" OnClientClick="$find('bPopupSearch').hide(); return false;" Text="X" Width="25px" /></td></tr></table><table width="100%"><tr><td><asp:GridView ID="gvSearchResults" runat="server" AutoGenerateColumns="False" Font-Names="Cordia New" AllowPaging="True" Width="100%" OnPageIndexChanging="gvSearchResults_PageIndexChanging" CssClass="searchResultsGrid" OnRowCommand="gvSearchResults_RowCommand"><Columns><asp:TemplateField HeaderText="cn"><ItemTemplate><asp:LinkButton ID="LinkButton1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "cn") %>' CommandArgument='<%# DataBinder.Eval(Container.DataItem, "adsPath") %>' CommandName="loadObject"></asp:LinkButton></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="objectClass"><ItemTemplate><asp:Label ID="Label18" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "objectClass") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="sAMAccountName"><ItemTemplate><asp:Label ID="Label19" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "sAMAccountName") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="physicalDeliveryOfficeName"><ItemTemplate><asp:Label ID="Label20" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "physicalDeliveryOfficeName") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="adsPath" Visible="False"><ItemTemplate><asp:Label ID="Label21" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "adsPath") %>'></asp:Label></ItemTemplate></asp:TemplateField></Columns><PagerSettings Mode="NumericFirstLast" /></asp:GridView></td></tr></table></ContentTemplate></asp:UpdatePanel></asp:Panel><!-- Empty Search Results Panel--><asp:Button ID="popupNoSearchResultsTargetControl" runat="server" Style="display: none" /><asp:ModalPopupExtender ID="popupNoSearchResults" runat="server" BackgroundCssClass="modalBackground" TargetControlID="popupNoSearchResultsTargetControl" PopupControlID="pnlPopupNoSearchResults" BehaviorID="bPopupNoSearchResults"></asp:ModalPopupExtender><asp:Panel ID="pnlPopupNoSearchResults" runat="server" CssClass="popupNoSearchResults"><asp:UpdatePanel ID="updPanelPopupNoSearchResults" runat="server" UpdateMode="Conditional"><ContentTemplate><table id="tblPopupNoSearchResultsHeader" align="center" cellpadding="0" cellspacing="0" width="100%"><tr><td style="border-bottom: solid; border-width: 3px; background-color: #c8332e; color: white; font-family: 'Cordia New'; border-bottom-color: black;" align="left"><div style="padding-left: 10px; font: bold; font-size: large;">
                                    Search Results:<asp:Label ID="lblPopupNoSearchResultsHeader" runat="server"></asp:Label></div></td><td align="right" style="background-color: #c8332e; color: white; border-bottom: solid; border-bottom-color: black; border-width: 3px; vertical-align: bottom;"><asp:Button ID="Button1" runat="server" BackColor="Black" BorderStyle="None" ForeColor="White" Height="25px" OnClientClick="$find('bPopupNoSearchResults').hide(); return false;" Text="X" Width="25px" /></td></tr></table><table width="100%"><tr><td></td></tr><tr><td align="center" style="font-family:'Cordia New';"><asp:Label ID="Label1" runat="server" Text="No objects found..." Font-Size="X-Large"></asp:Label></td></tr><tr><td></td></tr><tr><td align="center"><asp:Button ID="btnCloseNoResultsPopup" runat="server" CssClass="btn" Text="Close" OnClick="btnCloseNoResultsPopup_Click" /></td></tr></table></ContentTemplate></asp:UpdatePanel></asp:Panel></form></body></html>

how to make a Mutually Exclusive CheckBox, Compulsory

$
0
0

Hi all

Is it possible to make a Mutually Exclusive CheckBox, Compulsory?  If so what do I need to use as I can't see how the  required Field Validator would work on the below?  

<asp:CheckBox ID="chkBoxBPYes" runat="server" Text="Yes" /><cc1:MutuallyExclusiveCheckBoxExtender ID="cboBPYesExtender" runat="server" 
      Enabled="True" Key="benefitProtectionChoice" TargetControlID="chkBoxBPYes"></cc1:MutuallyExclusiveCheckBoxExtender><asp:CheckBox ID="chkBoxBPNo" runat="server" Text="No" /><cc1:MutuallyExclusiveCheckBoxExtender ID="cboBPNoExtender" runat="server" 
      Enabled="True" Key="benefitProtectionChoice" TargetControlID="chkBoxBPNo"></cc1:MutuallyExclusiveCheckBoxExtender>

button in update panel only fires on second click?

$
0
0

hi,

I have an update panel with a link button and image button. both are bound to events

only the link button works first click the Image button in bold below only works on Second click?


          
         <asp:UpdatePanel ID="UpdatePanel7" runat="server">



            <ContentTemplate>




        
    <asp:Panel ID="Panel8" runat="server" Visible="False">
    
   <h2>CONFIRMATION FORM</h2>


    

<asp:TextBox ID="txtDate1" runat="server"/> <asp:ImageButton ID="Calender" runat="server" ImageUrl="Calender.png" />

 <cc1:CalendarExtender ID="DateTextBox" TargetControlID="txtDate1" PopupButtonID="Calender" runat="server" />
    

 
        <asp:TextBox ID="Address" runat="server" TextMode="MultiLine" Rows="5" Width="300"></asp:TextBox>

  

                <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="ObjectDataSource2" DataTextField="CommonName" AppendDataBoundItems="True"
                                                    DataValueField="CountryId">
                 <asp:ListItem Text="--Select Country--" Value="" />   </asp:DropDownList>





                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                ControlToValidate="Country" ErrorMessage="SelectCountry" ToolTip="name is required."
                                          SetFocusOnError="True" >*</asp:RequiredFieldValidator>


    <p>
    
       About the peformance:
    </p>
 
        <asp:TextBox ID="Comments" runat="server" TextMode="MultiLine" Rows="5" Width="300"></asp:TextBox>

        
          

<p>If you have agreed a different amount <asp:LinkButton ID="Amount"
        runat="server" onclick="Amount_Click" CausesValidation="False">click here</asp:LinkButton>

        
        </p>

    <asp:Panel ID="Panel9" runat="server" Visible="False">
 


   <p>Select the amount</p>

       <asp:DropDownList ID="DropDownList3" runat="server">
            <asp:ListItem Text="--Select--" Value="" />
              <asp:ListItem Value="150.00" Selected="True">150.00</asp:ListItem>
         <asp:ListItem Value="200.00">200.00</asp:ListItem>
      
  


    </asp:DropDownList>

</p>


        </asp:Panel>



     

        
    <p style="padding-top: 10px; padding-bottom: 10px">

        <asp:ImageButton ID="ImageButton1" onclick="Button52_Click" runat="server" CausesValidation="False" ImageUrl="Images/CheckOutImage.png" />
       
 
    </p>

   

        
    
   </asp:Panel>

        
     
        </ContentTemplate>

 

            <Triggers>
        <asp:AsyncPostBackTrigger ControlID="LinkButton40" EventName="Click" />
    </Triggers>


        </asp:UpdatePanel>

How to use a gridview button inside an Accordion

$
0
0

Hello,

I have this code:

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:Accordion ID="Accordion1" runat="server"
                    SuppressHeaderPostbacks="true"
                    SelectedIndex="0"
                    HeaderCssClass="header"
                    HeaderSelectedCssClass="headerSelected"
                    ContentCssClass="contentAcc"
                    AutoSize="None"
                    FadeTransitions="true"
                    TransitionDuration="100"><HeaderTemplate><%--<asp:Label ID="lbHeaderID" runat="server" Text='<%# Eval("InspectionID")%>'></asp:Label>--%><table style="width:100%"><tr style="width:100%; background-color:lightgray"><td style="width:9.9%"> <asp:LinkButton ID="lbInspectionDate" Text='<%# Eval("SurveyDate")%>' runat="server"></asp:LinkButton> </td><td style="width:9.9%"> <asp:LinkButton ID="lbAuditors" runat="server" Text='<%# Eval("AudLastName")%>'></asp:LinkButton> </td><td style="width:9.9%"> <asp:LinkButton ID="lbVP" runat="server" Text='<%# Eval("VPLastName")%>'></asp:LinkButton> </td><td style="width:9.9%"> <asp:LinkButton ID="lbManager" runat="server" Text='<%# Eval("ManLastName")%>'></asp:LinkButton> </td><td style="width:30.5%"> <asp:LinkButton ID="lbOrg" runat="server" Text='<%# Eval("Organization")%>'></asp:LinkButton> </td><td style="width:9.9%"> <asp:LinkButton ID="lbFac" runat="server" Text='<%# Eval("Facility")%>'></asp:LinkButton> </td><td style="width:9.9%"> <asp:LinkButton ID="lbDeficiency" runat="server" Text='<%# Eval("Deficiencies")%>'></asp:LinkButton> </td><td style="width:9.9%"> <asp:LinkButton ID="lbCompleted" runat="server" Text='<%# Eval("Active")%>'></asp:LinkButton> </td></tr></table></HeaderTemplate><ContentTemplate><asp:HiddenField ID="hfInspectionID" runat="server" value='<%# Eval("InspectionID")%>' /><table style="width:100%"><tr style="width:100%"><td><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/delete2.jpg" /><br /><asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/250_PPT8800.jpg" /></td><td><asp:GridView ID="GridView1" runat="server" Width="100%" AutoGenerateColumns="False"><Columns><asp:BoundField DataField="Severity" HeaderText="Class" SortExpression="DeficiencyID" /><asp:BoundField DataField="Deficiency" HeaderText="Deficiency" SortExpression="ViolationID" /><asp:BoundField DataField="Completed" HeaderText="Completed" SortExpression="DeficiencyID" /><asp:BoundField DataField="DeficiencyID" HeaderText="Completed?" SortExpression="DeficiencyID" /><asp:ButtonField CommandName="Details_Click" HeaderText="Details" Text="Click Here" /><asp:TemplateField ><ItemTemplate>                           <asp:ImageButton  ID="btnViewDetails" runat="server" OnClick="btnViewDetails_Click" ImageUrl='<%#"~/images/250_PPT8800.jpg"%>' /> </ItemTemplate><ItemStyle HorizontalAlign="Right" /></asp:TemplateField></Columns></asp:GridView></td></tr></table></ContentTemplate></asp:Accordion></ContentTemplate></asp:UpdatePanel>

As you can see I have 2 buttons one is an image button the other is a gridview ButtonField button. In the code behind I have this code:

 

Protected Sub btnViewDetails_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)

        Dim ss As String

        Dim GridView1 As GridView = CType(Me.Accordion1.FindControl("GridView1"), GridView)
        Dim btnDetails As ImageButton = TryCast(sender, ImageButton)
        Dim row As GridViewRow = DirectCast(btnDetails.NamingContainer, GridViewRow)

        ss = row.Cells(3).Text
    End Sub
This works great when I run the code and click on the Image Button inside the grid the code behind fires and does what it is suppose to do.
My question is how do I make code behind that will capture the other button(gridview ButtonField button) click event?
Also can I put a button in the template field? and if so how to I make the code behind capture that click event?

Thank you


There is no source code available for the current location

$
0
0

I get this message "There is no source code available for the current location", on a ModalPopupExtender when I step through my program. I tried removing my AjaxControlToolkit reference and downloading the current version (3.5.7.123) for my system Windows 7, VS2008 version 9.0.30729.1 SP. And I still get the message. When I do not debug the ModalPopupExtender will display with out error, but it doesn't work right by updating the text I have on the panel.

Error when using an AJAX Calendar Extender in UpdatePanel

$
0
0

On my webpage, i have an UpdatePanel that contains an asp:panel Panel and some controls with an Ajax CalendarExtender.  The Panel initially has visibility set to false.  When i select a value from a dropdown, a GridView loads and if the number of rows in the gridview are greater than 0, i set the panel visibility property to true and call the Update method on the UpdatePanel.  When I do this, I receive the following js error:

0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Extender control 'tbIDMdate_CalendarExtender' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors().
Parameter name: extenderControl

I have done a bunch of research and so far nothing has worked.  I'm not sure what to do to get it to work, the error appears when I try to set the visibility property of the Panel to True.  My toolscriptmanager is located in the master page.

<asp:UpdatePanelID="updPnlAssignDeliveryMethods"UpdateMode="Conditional"runat="server">
                               
<ContentTemplate>
                                   
<asp:PanelID="pnlAssignDeliveryMethods"runat="server"Visible="false">
                                       
<asp:LabelID="Label18"runat="server"Text="IDM Date:"></asp:Label>
                                       
<asp:TextBoxID="tbIDMdate"runat="server"Width="75px"></asp:TextBox>
                                           
<ajaxToolkit:CalendarExtenderID="tbIDMdate_CalendarExtender"runat="server"Enabled="True"TargetControlID="tbIDMdate">
                                           
</ajaxToolkit:CalendarExtender>
                                       
<asp:LabelID="Label19"runat="server"Text="Delivery Method:"></asp:Label>
                                       
<asp:ButtonID="btnAssignSD"runat="server"CssClass="buttonBlue"OnClick="btnAssignSD_Click"Text="Seat Delivery"/>
                                        &nbsp;
<asp:ButtonID="btnAssignSelfDeploy"runat="server"CssClass="buttonBlue"OnClick="btnAssignSelfDeploy_Click"Text="Self Deploy"/>
                                        &nbsp;
<asp:ButtonID="btnAssignFS"runat="server"CssClass="buttonBlue"OnClick="btnAssignFS_Click"Text="Field Services"/>
                           
                                   
</asp:Panel>
                               
</ContentTemplate>
                           
</asp:UpdatePanel>

 

   


How to add Fileupload to my Listview?

$
0
0

Hi,

I created listview with image saved in Database,

Now I want to edit it,

I added File Upload to my listView in Edit Part

Now I want to save new image in Database (Update)

I Added this code to update Button

        protected void UpdateButton_Click(object sender, EventArgs e)
        {
            try
            {
                FileUpload fUpload = (FileUpload)ListView1.InsertItem.FindControl("FileUpload1");
                TextBox txtName = (TextBox)ListView1.InsertItem.FindControl("TextBox3");
                TextBox txtPrice = (TextBox)ListView1.InsertItem.FindControl("TextBox2");

                if (fUpload.HasFile && fUpload.PostedFile.ContentLength > 0)
                {

                    string fileName = fUpload.FileName;
                    byte[] fileByte = fUpload.FileBytes;
                    Binary imgBinary = new Binary(fileByte);

                    TestDataContext db = new TestDataContext();
                    Table1 t = new Table1()
                    {
                        Name = txtName.Text,
                        Price = int.Parse(txtPrice.Text),
                        image = imgBinary,
                    };
                    db.Table1.InsertOnSubmit(t);
                    db.SubmitChanges();

                    ListView1.DataBind();
                }
            }
            catch (Exception ex) { }
        }

What is problem here

Plz Help me THANKS

Losing current culture with ajax

$
0
0

Split off from http://forums.asp.net/t/1646509.aspx/1?Losing+current+culture+with+ajax#.

I have the same exact problem as the OP and it doesn't look like anyone answered his question probably because they didn't understand.

I have a page with a user control.  In the page I override the InitializeCulture method to set the CurrentCulture and CurrentUICulture to the one the user wants.

The user control works and when I check the current culture it's set correctly however when there is ajax involved and the user control does a ajax call back the currentthread culture is lost and set back to the machine not the one I set in the page load.

Is ajax launching a seperate thread for the callback which would explain the lost culture or is there another problem.  IT seems the only work around would be for every user control overrise the InitializeCulture method in it along with in the page.

Applying 3 Different Styles in ListView Control

$
0
0

Hello All,

 

I have three different styles sheets. Now i would like to apply 3 different styles in List View Control. My requirements are something like this

1 > I would like to display enabled records first

2> then for other records i would like to display alternating style.

 

Please suggest me. Is it possible?

 

Thanks

 

ScriptManager.RegisterStartupScript potentially causing issue with IE

$
0
0

Hello,
i'm using the scriptmanager to call different javascript based on page_load versus postback like so:

    if (!this.IsPostBack)
        {
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RedrawScript", "RedrawMarkup();", true);
        }

if (this.IsPostBack)
        {
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RefreshScript", "RefreshMap();", true);
        }

Now in IE only (works fine in Firefox), on the page_load the RedrawMarkup() javascript function is getting called. It goes up a frame and calls a function that draws a line. The issue I am having is that about half the time the line cannot be drawn because RedrawMark() never stops to allow you to draw it. It passes right on through to the handler function OnLineDigitized() which then complains about null line values. Since this seems to work fine in Firefox I'm wondering if it has anything to do with the way Scriptmanager behaves in IE7/8. IE is unfortunately our current company standard for browsers.

function RedrawMarkup() {

            var featureStr = parent.GetMapFrame().GetSelectionXML();

            if (featureStr.indexOf("Tenant Space") > -1) {
                document.getElementById("TYPE").value = "Tenant Space";
                parent.GetMapFrame().DigitizeLine(OnLineDigitized);
            }

            else alert("Select a tenant space before attempting to redraw markup.");

        }

        function OnLineDigitized(lineString) {

            document.getElementById("MAP").value = parent.GetMapFrame().GetMapName();
            document.getElementById("SELECTION").value = parent.GetMapFrame().GetSelectionXML();
            document.getElementById("SESSION").value = parent.GetMapFrame().GetSessionId();
            document.getElementById("INNERX").value = lineString.Point(0).X;
            document.getElementById("INNERY").value = lineString.Point(0).Y;
            document.getElementById("OUTERX").value = lineString.Point(1).X;
            document.getElementById("OUTERY").value = lineString.Point(1).Y;
            document.getElementById("form1").submit();

        }

Unable to consistently get checked rows in GridView when in UpdatePanel

$
0
0

I have a GridView located in an UpdatePanel on my webpage.  To take actions against checked rows in the GridView, I have a method that first determines if at least one row is checked.  Sometimes it works and sometimes it doesn't.  Typically the first time I check any number of rows, it returns false.  Then I recheck the rows again and it returns true and the actions begin.  After that is complete, I call GridView.Databind() to refresh the data.  At that time the evolution begins again, I have to check the rows twice for them to be captured in code as True.

int i = 0;
            foreach (GridViewRow row in GridView3.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    CheckBox check = row.FindControl("CheckBox1") as CheckBox;
                    if (check.Checked)
                    {
                        i++;
                    }
                }
            }
            if (i != 0)
            {
               //do something
            }

Viewing all 5678 articles
Browse latest View live




Latest Images