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

Ajaxified ASP.NET GridView updates on Dodownbox change event

$
0
0

I have an ajaxified ASP.NET GridView which dynamically populates the data on the dropdown change event. We use JQUERY and JASON on the page. When ever the trigger the dropdown change event the data changes. I have few check box columns in the Grid view and based on the checkbox checks I need to make some changes in the database.

But the value I get from the gridview  is always the value which is set during the default dropdown selection on the page load.

How can I make sure I can retrieve the exact value I see in the page based on the dropdown selection?.

FYI it's an ajax page and all the changes are designed in the client side. 


Ajax Control Toolkit Tabs Control - Help Themeing

$
0
0

Could someone help:

     I am thinking about using the Ajax Control toolkit tabs control but I will need to add some CSS to improve the look of the tabs.  I found (what I thought) would be the answer I was looking for with the following link http://mattberseth.com/blog/2008/04/ajaxcontroltoolkit_tabcontaine.html.  After checking it out I found that every link was dead and every piece of information that I found seemed to be outdated or lead back to this guy's blogs.

     My question is this.  Is the (Ajax Control Toolkit) Tab control out dated and not well supported anymore?  If not would anyone have any themes for the control.  I have looked at using the JQuery Tab control but the Ajax toolkit looks really nice and would be perfect if I could get a theme for it.

Any help / suggestions would be appreciated.

Thanks

Dave.

[Ajax.AjaxMethod()] Not working in Visual studio 2013

$
0
0

Hi,

I am Upgrading my project from VS2010 to VS2013.

I am calling Ajax methods from Javascript. By using [Ajax.AjaxMethod()] in .cs page.

In 2010 its working fine.

But in 2013 its giving errors as below 

Failed to load resource: the server responded with a status of 404           ajax/common.ashx not found.

But in our Application ajax folder it self not there.

In Web.config we added below code

<location path="Ajax" inheritInChildApplications="false"><system.web><httpHandlers><remove verb="*" path="*.asmx" /><add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" /></httpHandlers></system.web><system.webServer><handlers><remove name="Ajax" /><add name="Ajax" verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" /></handlers></system.webServer></location>

Even though I am getting same error. 

Then i tried to replace the dll's with latest .net 4.5 ajaxtoolkit Dll's, Tried installing AjaxToolkit via Nuget... Still no luck.

All Ajax methods are not working.

Please help me.

Thanks,

Shivanag.

Ajax Linecchart Chart Area

$
0
0

HI,

How to set ajaxcontroltoolkit linechart chart area colors and y axis start value and difference of y axis values.Let say Y axis vlues are like 5,10,15,20 then i need set  0-5 chartarea background color. 

AsyncPostBack Trigger Chrome

$
0
0

I have a radio button that has Async Postback.

When you click rbTomorrow radiobutton the async postback doesn't work in chrome

The functionality works in Safari, Firefox and IE. but the Async Postback doesn't work in chrome (production).  In my development environment the Async Postback works in Chrome but on production server it doesn't work.  I have hosting through godaddy.

Web.config is the same in development environment and production except for the connection strings.

It might have something to do with the radiobuttons being in an updatepanel but any advice is appreciated. 

Here is the html markup below .aspx. Thanks!

<table width="100%"><tr><td style="width:100%;" align="center"><asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">            <ContentTemplate>    <asp:LoginView ID="LoginView1" runat="server"><AnonymousTemplate><asp:Button ID="Button3" runat="server" PostBackUrl="~/Account/Login.aspx" Text="Login" /></AnonymousTemplate><RoleGroups><asp:RoleGroup Roles="Admin"><ContentTemplate>                                                                                                         <table width="100%"><tr><td style="width:75%; vertical-align:top;" align="center"><table width="100%">                                                    <tr>                                                                    <td style="width:10%;"></td><td style="width:80%;" align="center"><asp:Panel ID="Panel1" runat="server" CssClass="stepsHeader"><asp:Label ID="Label1" Font-Size="Large" Font-Bold="true" ForeColor="#7D7B03" runat="server" /></asp:Panel><asp:Panel ID="Panel2" runat="server" CssClass="stepsBody">                                       <table width="100%"> <tr><td style="width:100%;" align="center"><asp:Label ID="Label31" runat="server" ForeColor="Black" Text="<p style=&quot;color:#7D7B03; font-weight:bold;&quot; align=&quot;center&quot;> To Enter A WOD Entry</p>"></asp:Label></td></tr> <tr><td align="center"><table><tr><td align="center"><asp:RadioButton ID="rbToday" runat="server" style="color:white;" GroupName="WOD_Entry_Day" Text="Today" Checked="True" OnCheckedChanged="rbWOD_Entry_Day_Today_CheckedChanged" AutoPostBack="True" Visible="True" />                <asp:RadioButton ID="rbTomorrow" runat="server" style="color:white;" GroupName="WOD_Entry_Day" Text="Tomorrow" Checked="False" AutoPostBack="true" OnCheckedChanged="rbWOD_Entry_Day_Tomorrow_CheckedChanged" Visible="True" /></td>                                                       </tr><tr><td align="center"><asp:UpdatePanel ID="UpdatePanel_WODDate" runat="server">                                                                                         <ContentTemplate>                                                                  <fieldset><legend><font style="color:white;"><p>
                                                                           WOD Date </p></font> </legend><table><tr><td align="center"><asp:Label ID="lblDay" runat="server" ForeColor="White" Text="Test" Visible="true"></asp:Label></td></tr></table><table><tr><td><asp:ImageButton ID="btnLeftClick" runat="server" Text="" ImageUrl="~/Images/leftArrow.png" onclick="btnLeftClick_WOD_Scroll" Enabled="true" /></td><td align="center"><asp:Label ID="lblTomorrow" runat="server" ForeColor="White" Text="Test"></asp:Label></td><td><asp:ImageButton ID="btnRightClick" runat="server" Text="" ImageUrl="~/Images/rightArrow.png" onclick="btnRightClick_WOD_Scroll" Enabled="true" /></td></tr></table></fieldset></ContentTemplate></asp:UpdatePanel><asp:UpdateProgress ID="UpdateProgress1" runat="server"><ProgressTemplate><font style="color:Gold;"> Processing... </font></ProgressTemplate></asp:UpdateProgress>                                                            </td>                                                       </tr></table></td></tr>                                      <tr>

jQuery UI Autocomplete after saved the Items in Database how to bind back

$
0
0

Hi,

I have done Multiple select autocomplete with like tagging. After save the Values in DB. I want to bind it back in "div.ui-autocomplete-multiselect-item"
After saved i am getting a values what ever i saved. that should bind here.

Any idea suggestion. 



I have a multivariable multiple class json coming as a result.

$
0
0

I have a multivariable multiple class json coming as a result.  From [WebMethod} I have this string returning (certain it is correct):

[{"id":"0","date":"3/4/2001","name":"John Doe","title":"IT"},{"id":"1","date":"3/4/2001","name":"Jane Doe","title":"Homemaker"}]

etc

I want TextBox4 to print the json string.

Right now it just prints out the Error Code:

Error Code: Status: [object Object] Ex: error

How can I correct that?

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><script type="text/javascript">$(document).ready(function () {$("#<%= Button1.ClientID %>").click(function () {
                var mo1 = $("#<%= TextBox1.ClientID %>").val();
                var dy1 = $("#<%= TextBox2.ClientID %>").val();
                var yr1 = $("#<%= TextBox3.ClientID %>").val();
                var data = { mo:mo1, dy:dy1, yr:yr1 };
                var json1 = JSON.stringify(data);$.ajax
                ({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    data: json1,
                    url: "Default.aspx/GetDateData",
                    success: function (result) {$("#<%= TextBox4.ClientID %>").val(result.d);
                    },
                    error: function (status, ex) {
                        alert("Error Code: Status: " + status + " Ex: " + ex);
                    }
                });
                return false;
            });
        });</script>

How allow items in combobox/dropdownlist that aren't in the list

$
0
0

I am converting an Access database to an ASP web page.  One field contains a list of people. I want the dropdown to only contain certain people, but there is already allot of names that are not those certain people.  I want to allow the old data to stay in the database, but any new ones, or if they edit and change the current name, I want it to have to be in the list, but if they don't change it the name, I don't want it to throw an error.

   I have my SelectedValue='<%#bind("RequestedBy")%>'.  

If the data in the database is in the list, it works fine.

If the data in the field is not in the list, I get an error, because combobox has a selectedvalue which is invalid because it does not exist in the list of items.

How do I just ignore it if the name isn't in the list? I want the name to stay in the box, even if its not in the list. Only if I try to change it, do I want to have to choose from an item in the list.


Update panel does not work inside formview?

$
0
0

I have a simple formview that binds to a SQL database. This formview is used for adding new records only since its default view is Insert. For simplicity I put one label and one bound textbox inside the insert item template. All works fine. However, if I put an update panel inside the formview's insert item template the formview's update method fails becuase of a null value. If I look at the text property of my bound textbox right before the update I can see the value just added. So it appears the control has the value but it's almost as if the data binding has been broken. Of course if I remove the update panel everything works fine. If I put the entire formview inside an update panel it works fine, too. But since I will want to trigger my update panel off a particular control inside the insert item template, the update panel must be inside the template. I've seen a few similar posts on the net but no answers. Is this at all possible???

Error databinding textbox inside UpdatePanel and UpdatePanel is embedded in Formview

$
0
0

I have placed a databound textbox within an UpdatePanel.  The UpdatePanel is embedded in a formview.

When the formview is edited and saved, in the formview ItemUpdating event, the field bound to the textbox e.NewValues("FieldName") is nothing and a blank value is saved in the database.  However, if I take the textbox out of the UpdatePanel, the field bound to the textbox e.NewValues("FieldName") maintains its value and updates the database correctly.

Is there a fix for this problem?

Here is my sample code:

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

<asp:FormViewID="formview1"runat="server"DataKeyNames="Num" DataSourceID="ODS">

<EditItemTemplate>

<asp:ButtonID="btnSave"runat="server"Text="Save"SkinID="CommandButton"CausesValidation="True"CommandName="Update"/>&nbsp;&nbsp;

<asp:ButtonID="btnCancel"runat="server"Text="Cancel"SkinID="CommandButton"CausesValidation="False"CommandName="Cancel"/>

<br/><br/>

<asp:UpdatePanelID="upTypeOrg"runat="server"UpdateMode="Conditional">

<ContentTemplate>

<asp:TextBoxID="TextBox1"Runat="server"Text='<%# Bind("FieldName") %>'Rows="4"TextMode="MultiLine"width="200px"EnableViewState="True"/>

</ContentTemplate>

</asp:UpdatePanel>

</EditItemTemplate>

</asp:FormView>

<asp:ObjectDataSourceID="ODS"runat="server"TypeName="SampleBLL"SelectMethod="GetData"UpdateMethod="UpdateData">

<SelectParameters>

<asp:QueryStringParameterName="Num"QueryStringField="Num"Type="String"DefaultValue=""/>

</SelectParameters>

<UpdateParameters>

<asp:ParameterName="Num"Type="String"/>

<asp:ParameterName="FieldName"Type="String"/>

</UpdateParameters>

</asp:ObjectDataSource>

 

Thank you.

ModalPopupExtender :TypeError: Cannot read property 'show' of null

$
0
0

Hello, I'm trying to show a popup ModalPopupExtender  from Javascript when clicks a button

function GetDropDownData() {
   document.getElementById("<%=ModalPopupExtender1.ClientID%>").show(); 
    return false;
}
<cc1:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="mpe" runat="server" DropShadow="false"
PopupControlID="pnlPopup" TargetControlID="btnCat" BackgroundCssClass="modalBackground" OkControlID="btnOK" ></cc1:ModalPopupExtender><asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" ><div id="divheader" style="background-color:White;width:100%;"><iframe src="Catalog.aspx" style='height: 400px; width: 400px' scrolling='no' frameborder='0'></iframe><br /><asp:Button ID="btnOK" runat="server" EnableTheming="True" EnableViewState="False" Text="OK" Width="40px" /></div> </asp:Panel>

but it gives me Javascript runtime error

TypeError: Cannot read property 'show' of null

It works on another page but I don't know what is wrong here.

Thank you

Issue with Image loading in Ajax

$
0
0

Hi All,

We have issue with image loading while using AJAX

- We are using UpdatePanel to validate the request.

Issue:

On page load below code is working fine.

imgVefrification.ImageUrl = "ImageValidate.aspx";

On button click after validating the image value, if validation fails we are trying to call it again.

But image is not getting refreshed (Debug is not hit/process "ImageValidate.aspx" page)

Please suggest.

with update panel ScriptManager.RegisterStartupScript( is not working

$
0
0

Dear all,

I am using update panel on my page  and  want to print a gridview.

If i remove the update panel, the below code is working..

Following is my code

Protected Sub btnPrint_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPrint.Click  
            gvDetails.PagerSettings.Visible = False
            gvDetails.Visible = True
            gvDetails.AllowPaging = False
            gvDetails.DataSource = dt
            gvDetails.DataBind()
            Dim sw As New StringWriter()
            Dim hw As New HtmlTextWriter(sw)
            gvDetails.RenderControl(hw)
            Dim gridHTML As String = sw.ToString().Replace("""", "'").Replace(System.Environment.NewLine, "")
            Dim sb As New StringBuilder()
            sb.Append("<script type = 'text/javascript'>")
            sb.Append("window.onload = new function(){")
            sb.Append("var printWin = window.open('', '', 'left=0")
            sb.Append(",top=0,width=1000,height=600,status=0');")
            sb.Append("printWin.document.write(""")
            sb.Append(gridHTML)
            sb.Append(""");")
            sb.Append("printWin.document.close();")
            sb.Append("printWin.focus();")
            sb.Append("printWin.print();")
            sb.Append("printWin.close();};")
            sb.Append("</script>")
            ScriptManager.RegisterStartupScript(Me, Me.GetType(), "Print", sb.ToString(), True)        
            gvDetails.PagerSettings.Visible = True
            gvDetails.DataBind()
            gvDetails.Visible = False
     end sub

its showing me nothing

thanks

nick

problem with validation control in updatePanel control

$
0
0

Hi all,

I am missing a problem with validation control in updatePanel control:

I want to hide updatepanel control when page load. When click show button then updatepanel  control will show.

It show when I remove RequiredFieldValidator  control, and don't show when I add RequiredFieldValidator  control in updatepanel. But I want to validate data

Help me how to does it work?Please.

my code here:

default.aspx page:

<asp:ScriptManager ID="ScriptManager2" EnablePageMethods="true" runat="server"></asp:ScriptManager>

<asp:UpdatePanel ID="udpTest" runat="server" Visible="False">
    <ContentTemplate>
        Test <asp:Button ID="Button1" runat="server" Text="Button" /><asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
       <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
   </ContentTemplate>
</asp:UpdatePanel>

<asp:Button ID="btnShow" CssClass="btn btn-info" runat="server" Text="Show" OnClick="btnDatHang_Click" />

and code behind default.cs:

protected void btnShow_Click(object sender, EventArgs e)
{
     udpTest.Visible = true;
}

AJAX Calendar

$
0
0

Hi folks, how do you gray out unavailable dates in AJAX calendar code below, ta

code so far

 {
                 base.OnInit(e);
                 //set the validator min and max values
                 this.CalendarExtender2.StartDate = DateTime.Today.AddDays(2);
             }


JS runtime error: Object expected : in Binding

$
0
0

Hi,

I have retrieve data from database using json. But i got an error like JS runtime error: Object expected

In aspx

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script><script type="text/javascript">$(document).ready(function () {$.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "WebForm1.aspx/DisplayData",
            data: "{}",
            dataType: "json",
            success: function (data) {$("#lbltxt").text(data.d);
            },
            error: function (result) {
                alert("Error");
            }
        });
    });</script>

<label id="lbltxt" runat="server"></label>

In aspx.cs

[System.Web.Services.WebMethod]
        public static string DisplayData()
        {
            return DateTime.Now.ToString();
        }

 

dropwonlist with image and text option

$
0
0

Hi

i would like to make my dropdownlist like this

I'm using Vb.net with visual studio 2012.

Ajax control Tabs are not working after Print button clicked

$
0
0

I am biniding sql data to Ajax tab control in page,then I have button called Print, in this I useed window.print() when I click Print button means its showing Print preview page, after I click cancel the Ajax tabs are not working unbale to open new tabs.

JQuery UI Autocomplete multiple select text box text going hidden left side

fire GridView1_RowCommand more then once

$
0
0

I'm new to asp, I have a tabcontainer with 1 tabpanel created at design time.tabpanel contained a gridview filled with usernames. with code below, if I click on detail button beside any username I got 4 new tabs created with different info, and I can browse between these tabs no problem. but if I go back to my main tab where all username and click a different user, nothing happen. any idea on how to solve this problem ? thank you

<form id="form1" runat="server"><div id="divGrid">                                                          <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><cc1:TabContainer AutoPostBack="true"  ID="TabContainer1" runat="server" Height="700" ScrollBars="Both"><cc1:TabPanel ID="MenuAddTwoNums" HeaderText="User" runat="server"><ContentTemplate><asp:PlaceHolder ID="UC1Holder" runat="server"><ContentTemplate><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  
                                Font-Bold="False" Font-Size="Small" GridLines="Horizontal" style="width:50%"  
                                HorizontalAlign="Left" OnRowCommand="GridView1_RowCommand" Height="630px" ><AlternatingRowStyle Height="10px" /><Columns><asp:BoundField DataField="name" HeaderText="Name" /><asp:BoundField DataField="SamAccountName" HeaderText="Username" /><asp:BoundField><ItemStyle Width="20px" /></asp:BoundField><asp:BoundField /><asp:BoundField /><asp:ButtonField ButtonType="Image" CommandName="Details" 
                                        ImageUrl="~/Resources/Images/view.gif" Text="Details"><ItemStyle Width="30px" /></asp:ButtonField></Columns><EditRowStyle BackColor="#99CCFF" BorderStyle="None" Font-Size="Small" 
                                    ForeColor="Black" Height="30px" HorizontalAlign="Left" /><HeaderStyle BackColor="White" BorderColor="#CCCCCC" Font-Size="Small" 
                                    HorizontalAlign="Left" /><RowStyle BackColor="White" BorderColor="#CCCCCC" Font-Size="Small" 
                                    HorizontalAlign="Left" /><SelectedRowStyle BackColor="White" BorderColor="#CCCCCC" /></asp:GridView></ContentTemplate></asp:PlaceHolder></ContentTemplate></cc1:TabPanel></cc1:TabContainer></ContentTemplate></asp:UpdatePanel>
   protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {

        if (IsPostBack)
        {
            if (e.CommandName == "Details")
            {


                List<string> result1 = new List<string>();
                   List<string> UserAP = new List<string>();
                List<string> UserGROUP = new List<string>();
                List<string> UserSHARED = new List<string>();
                int row = int.Parse(e.CommandArgument.ToString());
                item = GridView1.Rows[row].Cells[1].Text;
                DirectoryEntry de = new DirectoryEntry();
                de.Path = "LDAP://xx.com";
                DirectorySearcher objADSearcher = new DirectorySearcher(de);
                de.AuthenticationType = AuthenticationTypes.Secure;

                objADSearcher.SearchRoot = de;
                objADSearcher.Filter = "(SAMAccountName=" + item + ")";
                SearchResult results = objADSearcher.FindOne();
                if (results.ToString() != "")
                {

                    int flags = Convert.ToInt32(results.Properties["userAccountControl"][0].ToString());
                    //for reference results.Properties["userAccountControl"][0].ToString().Equals("514");

                    if (Convert.ToBoolean(flags & 0x0002))
                    {
                        Response.Write("<script> alert ('" + "Account Disabled  + "') </script>");


                    }
                    else
                    {


                        WindowsIdentity wi = new WindowsIdentity(item);


                        foreach (IdentityReference group in wi.Groups)
                        {
                            try
                            {

                                result1.Add(group.Translate(typeof(NTAccount)).ToString());
                                result1.Sort();

                            }
                            catch (Exception ex)
                            { }
                        }
                AjaxControlToolkit.TabPanel apptab = new AjaxControlToolkit.TabPanel();

                        apptab.HeaderText = item + " " + "Application";
                        apptab.ID = "tab1";
                        AjaxControlToolkit.TabPanel sharedtab = new AjaxControlToolkit.TabPanel();

                        sharedtab.HeaderText = item + " " + "SharedCommon";
                        sharedtab.ID = "tab2";
                        AjaxControlToolkit.TabPanel grouptab = new AjaxControlToolkit.TabPanel();

                        grouptab.HeaderText = item + " " + "Internet/RAS";
                        grouptab.ID = "tab3";
                        AjaxControlToolkit.TabPanel idtab = new AjaxControlToolkit.TabPanel();

                        idtab.HeaderText = item + " " + "Info";
                        idtab.ID = "tab4";


                        TabContainer1.Tabs.Add(grouptab);
                        TabContainer1.Tabs.Add(apptab);
                        TabContainer1.Tabs.Add(sharedtab);
                        TabContainer1.Tabs.Add(idtab);

Viewing all 5678 articles
Browse latest View live




Latest Images