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

MaskedEditValidator Page.IsValid returns false when using "en-UK" culture

$
0
0

<asp:TextBox id="txtDate" runat="server" Width="70"
                                        Text='<%# DataBinder.Eval(Container.DataItem, "Date") %>'/><atk:MaskedEditExtender ID="meeDate" CultureName="en-GB" runat="server" Mask="99/99/9999" MaskType="Date" TargetControlID="txtDate" PromptCharacter="_" /><atk:MaskedEditValidator ID="mevDate" runat="server" ControlExtender="meeDate" ControlToValidate="txtDate"
                                        EmptyValueMessage=" *" InvalidValueMessage="Date is invalid" IsValidEmpty="False" CssClass="validatorError" />



The following setup seems to work fine on the client side, however when I post back and check Page.IsValid, the value is false.  I also looked at mevDate.IsValid and it's false.  It seems that setting the CultulreName on the MaskedEditExtender is sufficient to get the MaskedEditValidator to emit the correct JavaScript, but on the server side of things it doesn't work.  When I flip CultureName to "en-US" everything works as expected.


update progress for ajax modal popup called from server side

$
0
0

Im trying to call ajax modal pop up from  code behide file in c#. my modal popup contain  a message and two buttons Yes /no . and have to execute some function inside the yes button in server side. I wnt to use update progress while system executing the server side function of yes button click event. How to do that.... 

I already have a update progress along with page that will dispaly for all control in this page. but when i used the below pannel4 associated with modal popup..   its events ( yes button click) not displaying any updates..

<asp:Button ID="Button5" runat="server" Text="Button" CausesValidation="False" Style="display: none" />

<!-- ModalPopupExtender -->
<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel4" TargetControlID="Button5"
CancelControlID="btnmsgCancel" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>

<asp:Panel ID="Panel4" runat="server" CssClass="modalPopup2" align="center" >
<table style ="width: 100% ; height :100%;">
<tr>
<td colspan = "3" align ="center" style =" height :60%;">
<asp:Label ID="lblmsg" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td colspan= "3" style =" width:2px;">
<hr/>
</td>
</tr>
<tr>
<td align ="right">
<asp:Button ID="btnmsgOk" runat="server" CssClass="btn" Width="60px" Text="Ok" OnClick ="btnmsgOk_Click"/>
</td>
<td style =" width :50px;">
</td>
<td align ="left">
<asp:Button ID="btnmsgCancel" runat="server" CssClass="btn" Width="60px" Text="Cancel" />
</td>
</tr>
</table>
</asp:Panel>

protected void btnmsgOk_Click(object sender, EventArgs e)

{

// some functions here

//while executingg themm update progress has to work..

}

not showing ajax modal popup from javascript.

$
0
0

So I have two options here. on an asp button with id="Btn1"  I have OnClientClick="popConfirm()" or I could do this from code behind Btn1.OnClientClick = String.Format("popConfirm()") and so forth.  I want to be able to master both here but ultimately choose either one in different scenarios.

Problem 1: The problem I'm facing that I can't stop the code behind version to stop and wait for a confirm button clicked in the modalpopup. It will just continue to run code. Is there something I'm doing wrong here. How can I get it to stop and wait and listen that confirm has been clicked?

Problem 2: If I use javascript function popConfirm(), its not finding the ajaxmodalpopup control and I've even (I think) properly resorted to using the BehaviorID.  It just returns null object found. Here below is this version.

<script type="text/javascript">
    function popConfirm() {
        var theModal = $find('confirmPopUp');
        theModal.show();
        return false;
    }</script><asp:Button runat="server" ID="inviteall" CssClass="btn btn-default" OnClientClick="popConfirm()" meta:resourcekey="InviteAll" CommandName="InviteSelected" Visible='<%# SurveyControlPanel1.IsPublished && SurveyControlPanel1.AllowInvites %> ' /><!--.modal-content --><asp:ImageButton ID="imgHiddenConfirm" runat="server" CausesValidation="false" Style="display: none" /><ajaxToolkit:ModalPopupExtender ID="confirmModalPopup" runat="server"  BackgroundCssClass="modalBackground" BehaviorID="confirmPopUp" CancelControlID="PopupCloseButton" PopupControlID="pnlConfirm" TargetControlID="imgHiddenConfirm"></ajaxToolkit:ModalPopupExtender><asp:Panel ID="pnlConfirm" runat="server" CssClass="modalPopup" Style="display: none"><div id="mod-info4"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"></div><div class="modal-body"><div class="text-center"><div class="i-circle info"><i class="fa fa-info"></i></div><h3>Invite(s)</h3>
                            Are you sure you want to send invites to selected users?</div></div><div class="modal-footer"><asp:Button ID="btnClose" runat="server" CssClass="btn btn-default" Text="Ok" /><asp:Button ID="btnConfirm" runat="server"  Text="Confirm" /></div></div></div></div></asp:Panel><!-- /.modal-content -->

So what's going on here in both scenarios? thanks for any help

PasswordStrength not showing

$
0
0

Hi All,

I cannot understand why my PasswordStrength control is not showing.

Here is my code:

<asp:TextBox runat="server" ID="Password" TextMode="Password" CssClass="txtbox" /><br />  <br /><asp:PasswordStrength ID="PasswordStrength" 
         runat="server" 
         DisplayPosition="RightSide"
         TargetControlID="Password" 
          RequiresUpperAndLowerCaseCharacters="false"
            StrengthIndicatorType="BarIndicator" 
         TextStrengthDescriptions="Not enough long; Not enough long; Fair; Strong; Very Strong" 
         HelpStatusLabelID="passwordstatus" 
         PreferredPasswordLength="8" 
         MinimumSymbolCharacters="1"
        MinimumUpperCaseCharacters="1" 
         MinimumNumericCharacters="1"
         BarBorderCssClass="barBorder" 
          StrengthStyles="Notenoughlong;Fair;Strong;VeryStrong;"></asp:PasswordStrength> <br /> <asp:Label ID="passwordstatus" runat="server" Text="Label"></asp:Label>

here is my CSS:

.BarBorder
{
    border: 1px solid #CCCCCC;
    width: 233px;
    padding: 5px;
    float: left;
}
.Notenoughlong
{
    background-color: #C60000;
}
.Fair
{
    background-color: #4FB000;
}
.Strong
{
 background-color: #4FB000;
}
.VeryStrong
{
 background-color: #4FB000;
}

What am I missing? 

I didn't add the Scriptmanager in the register page because this has been added already into the masterpage.

Thanks

Modalpopupextender inside another modalpopupextender

$
0
0

I have have user control pages inside a modalpopupextender. Where modalpopextender2 is inside modalpopuextender1. when i click on the targetcontrol ID of modalpopextender page is displayed at the same time if i do modalpopextender2.show() i am getting a blank background page without any controls on it Please help me.

Below is my sample code

Main Page.ASPX

<div id="requiresearch" runat="server">
<ajax:ModalPopupExtender ID="ReqSearch1" runat="server" BackgroundCssClass="ModalPopupBG"
PopupControlID="SearchReq" BehaviorID="modalrequirementsearch" TargetControlID="searchPopup">
</ajax:ModalPopupExtender>
<asp:UpdatePanel ID="SearchReq" runat="server">
<ContentTemplate>
<uc1:requirementsearchpage ID="requirementsearch" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>

MainPage ASPX.CS

if (Req_ID.Text != "")
{
requirementsearch.bindgrid();
ReqSearch1.Show();

}

UserControlPage1.ASCX

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="requirementsearchpage.ascx.cs" Inherits="QUANTM.Controls.requirementsearchpage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<%@ Register Src="~/Controls/requirementviewpage.ascx" TagName="requirementview1" TagPrefix="uc3" %>


<!-- REQUIREMENT SEARCH POPUP -->

<div id="requirementview" runat="server">
<ajax:ModalPopupExtender ID="modalRequirementView" BackgroundCssClass="ModalPopupBG"
runat="server" TargetControlID="button1" BehaviorID="modalrequirementdata" PopupControlID="ReqView">
</ajax:ModalPopupExtender>
<asp:UpdatePanel ID="ReqView" runat="server">
<ContentTemplate>
<uc3:requirementview1 ID="ucRequirementView" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>


<asp:Panel runat="server">

<div class="modal container" style="margin-left: 4px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" onclick="$find('modalrequirementsearch').hide(); return false;" aria-hidden="true"></button>

<h3><a class="brand" href="requirement.aspx">
<img src="assets/img/logo.png" alt="logo" style="padding-right: 20px" />
</a>Requirements</h3>
</div>
<div class="modal-body">
<div class="span5">

<div class="control-group">
<label class="control-label" style="width: 140px;">Search Requirement</label>
<div class="controls">
<asp:TextBox ID="searchTxt" runat="server" Width="60%" CssClass="span6 select2"></asp:TextBox>
<%--<input style="width: 60%" type="hidden" id="select2_sample3" class="span6 select2">--%>
</div>
</div>

</div>
<div class="span6 last">
<button class="btn blue" style="float: right"><i class="icon-list-ol"></i>Select All</button>
</div>
<div style="clear: both"></div>
<div style="height: 300px; overflow: scroll" data-rail-visible1="1">
<div class="portlet-body no-more-tables">
<asp:GridView ID="grvAllRequiremnt" runat="server" CssClass="table-bordered table-striped table-condensed cf" AutoGenerateColumns="false">

<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="reqSelectall" runat="server" AutoPostBack="true" CausesValidation="false" OnCheckedChanged="selectall_CheckedChanged" />
</HeaderTemplate>
<HeaderStyle BackColor="#0083CA" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemTemplate>
<asp:CheckBox ID="reqRowcheck" runat="server" />
</ItemTemplate>
</asp:TemplateField>

<asp:BoundField DataField="Requirement_Name" HeaderText="Requirement Name" HeaderStyle-CssClass="cf table-head" HeaderStyle-BackColor="#0083ca" />
<asp:BoundField DataField="requirement_ID" HeaderText="Requirement ID" HeaderStyle-CssClass="cf table-head" HeaderStyle-BackColor="#0083ca" />
<asp:BoundField DataField="Created_by" HeaderText="Created By" HeaderStyle-CssClass="cf table-head" HeaderStyle-BackColor="#0083ca" />
<asp:HyperLinkField HeaderText="View" HeaderStyle-CssClass="cf table-head" Text="View" HeaderStyle-BackColor="#0083CA" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" />
</Columns>
</asp:GridView>

</div>
</div>
</div>

<div style="clear: both"></div>
<div class="modal-footer">
<asp:Button ID="btnDone" runat="server" CssClass="btn blue" OnClick="btnDone_Click" Text="Done" />
<asp:Button ID="button1" OnClick="button1_Click" runat="server" CssClass="btn blue" Text="Done"/>
<asp:Button ID="btncre" runat="server" OnClick="btncre_Click" />

</div>
</div>
</asp:Panel>
<!-- END REQUIREMENT SEARCH POPUP -->

UserCOntrol ASCX.CS

protected void btncre_Click(object sender, EventArgs e)
{
modalRequirementView.Show();
}

usercontrol2 ASCX

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="requirementviewpage.ascx.cs" Inherits="QUANTM.Controls.requirementviewpage" %>
<!-- REQUIREMENT DATA POPUP -->
<asp:Panel runat="server">
<div class="modal container" style="margin-left: 4px;">
<div id="header1" class="modal-header">
<button type="button" class="close" data-dismiss="modal" onclick="$find('modalrequirementdata').hide(); return false; return false;" aria-hidden="true"></button>
<h3>Requirements</h3>
</div>
<div class="modal-body">
<div class="portlet" style="margin-top: 0px; margin-bottom: 0px">
<div class="portlet-body">
<div class="row-fluid">
<!--BEGIN TABS-->

<div class="control-group">
<label class="control-label">Req Name</label>
<div class="controls">
<asp:TextBox ID="ucReqName" runat="server" type="text" placeholder="Req Name" class="m-wrap small"></asp:TextBox>
</div>
</div>
<div class="control-group">
<label class="control-label">Req ID</label>
<div class="controls">
<asp:TextBox ID="ucReqID" runat="server" placeholder="Req ID" class="m-wrap small"></asp:TextBox>
</div>
</div>
<div class="control-group">
<label class="control-label">Req Type</label>
<div class="controls">
<asp:TextBox ID="ucReqType" runat="server" placeholder="Req Type" class="m-wrap small"></asp:TextBox>
</div>
</div>

</div>

AjaxControlToolkit ComboBox DropDown hiding on Scrollbar click

$
0
0

I use a AjaxControlToolkit Combobox with the following Settings:

SuggestAppend = SuggestAppend

DropDownStyle = DropDown

My DropDown height is limited, so I enabled vertical Scrolling via CSS. But if I click in the TextBox to open my DropDown and then click on the scrollbar, the DropDown immediately disappears.

This seems to be caused by the internal _onTextBoxBlur javascript event of the Combobox assembly.

Can I get rid of this behaviour without recompiling a modified assembly?

Any help would be much appreciated!

Async file upload resets other controls

$
0
0

I have a set of regular controls (drop downs, text boxes, etc.) and an async file upload control, all inside an update panel.

When I select an item from drop down list and then upload a file, after file upload is complete the drop down gets reset to its original value; same thing with other controls.

In the onClientUploadComplete I have "__doPostBack("update_panel_ID"). If I remove this line, when file is being uploaded, I get "htmlfile: Unspecified error." followed by "Microsoft JScript runtime error: Permission denied"; it happens at this line "if(document.getElementById(this.mainDivId)==null".

Is there any way I can stop the other controls from getting reset? I know it is due to the __doPostBack(...) but if I remove it I get all these JS errors.

Thanks.

Please Help me to select event for getting cities in INDIA after calling web service for states in INDIA.

$
0
0

Hi All,

I am populating Autocomplete data in textbox with states name in India by using below web service code:

 [System.Web.Services.WebMethod]
    public static string[] GetNames(string prefixText, int count)
    {
        NamesDataContext db = new NamesDataContext();

        return db.StateAndCityMasters.Where(n => n.state.StartsWith(prefixText)).OrderBy(n => n.state).Select(n => n.state).Take(count).ToArray();
    }

Also in design file as below :

<td><ajaxToolkit:AutoCompleteExtender ID="txtName_AutoCompleteExtender" runat="server"
                TargetControlID="statecombo" MinimumPrefixLength="1" ServiceMethod="GetNames"></ajaxToolkit:AutoCompleteExtender></br><asp:TextBox ID="statecombo" runat="server" AutoComplete="Off"  CssClass="txtfld3" Font-Size="Large"  ></asp:TextBox></td>

I want to populate cities in indian states after typing State name in the state textbox .

Now  my problem is in which event i should write code to get cities in States in India to populate cities drop down list .

Please help me to select specific event where i can populate cities in city drop down list.

Regards,

Jayesh.(From India,Mumbai)


Working with Early AJAX

$
0
0

Early AJAX, I am having no luck with this. 

I am not getting any errors, although. 

But none of the "document.getElementById"s are printing out either. 

Could someone show me the path.

Default.aspx<head><script type="text/javascript">
        function getajax() {
            var xhr;
            if (window.XMLHttpRequest) {
                xhr = new XMLHttpRequest();
            }
            else if (window.ActiveXObject) {
                xhr = new ActiveXObject("Msxml2.XMLHTTP");
                document.getElementById("<%=Label1.ClientID%>") = "Windows";
            }
            else {
                throw new Error("Ajax is not supported by this browser");
                document.getElementById("<%=Label2.ClientID%>") = "Ajax is not supported by this browser";
            }
            xhr.onreadystatechange = function () {
                if (xhr.readyState == 4) {
                    if (xhr.status >= 200 && xhr.status < 300) {
                        //executes on success
                        document.getElementById("<%=Label3.ClientID%>") = "Success";
                        xhr.open("POST", Default.aspx / GetValue);
                        xhr.send();
                    }
                    else {
                        //executes on error
                        document.getElementById("<%=Label2.ClientID%>") = "Error";
                    }
                }
            }
        }</script></head><body><form><asp:Label ID="Label1" runat="server" Text=""></asp:Label><asp:Label ID="Label2" runat="server" Text=""></asp:Label><asp:Label ID="Label3" runat="server" Text=""></asp:Label><asp:Button ID="Button1" runat="server" Text="Execute" OnClick="Button1_Click" /></form></body>

Default.aspx.cs
        protected void Button1_Click(object sender, EventArgs e)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Javascript", "Javascript:getajax();", true); 
        }

autocomplete doesnot get fired

$
0
0

using autocomplete  with  <ajaxToolkit:AutoCompleteExtender  but nothing happens .
the textbox has autopostback=false
on debugging autocomplete.vb page nothing happens

Saving Uploaded Image To Folder

$
0
0

Hi all, I am attempting to create a C# version of the drag drop image uploader. Most of the tutorials I have seen on the subject were using  javascript xhr object and php. My problem is after sending the image to the server in the form of an xhr object, I'm not quite sure how to access that image file and save it to the folder of my choice. The following are snippets of javascript for sending an image file from the frontend to the server.

 function upload(file) {
                 xhrObj = new XMLHttpRequest;
                 xhrObj.open('post', 'DragDrop.aspx', true);
                 xhrObj.setRequestHeader('Content-Type', "multipart/form-Data");
                 xhrObj.setRequestHeader('X-File-Name', file.fileName);
                 xhrObj.setRequestHeader('X-File-Size', file.fileSize);
                 xhrObj.setRequestHeader('X-File-type', file.fileType);

                 xhrObj.send(file);
            };

The following is the C# code in the codebehind of DragDrop.aspx which I've tried to use to access the image file and save it to the folder of my choice in Visual Studio:

protected void Page_Load(object sender, EventArgs e)
        {
            Stream input = (Stream)Request.InputStream;

            Bitmap bmp = new Bitmap(input);
            Response.Clear();            
            
            switch(input.GetType().ToString())
            {
                case "jpeg":
                Response.ContentType = "image/jpeg";
                    break;
                case "gif":
                    Response.ContentType = "image/gif";
                    break;
                case "png":
                    Response.ContentType = "image/png";
                    break;
                default:
                    Response.ContentType = "application/octet-stream";
                    break;
            }

            Response.ContentType = "image/jpeg";
            bmp.Save("@'Upload\test1.jpeg'", ImageFormat.Jpeg);
        }

The code throws no error and nothing happens when I drag and drop my image into a DIV which had been designated as a droppable DIV on my webpage. I've already made sure that the javascript is working and that it's not the reason for the upload failure. Please take a look at my code and point out anything that I might be doing wrong. Thanks in advance for your help.

How to select year only from Calendar Extender

$
0
0

Hi:

I hope to make the calendar extender to show  year only , not show month or day, 

I have tried following codes:

function ChangeCalendarView(sender,args)
{
sender._switchMode("years", true);            
}

however, the effects not meet the hope, since it only show year at first, but still will show month and days.

And after doing some research, I found some codes about year/month, like following:

http://weblogs.asp.net/aghausman/how-to-show-and-select-month-year-in-calendar-extender

it can work for year/month, but if I want year only, how to modify that. 

It is not so clarify to change it. Any instructions is appreciated, thanks a lot. 

Modal popup problem

$
0
0

I have a modal popup that is part of the master page that opens a login  form when triggered. This opens as it should and you can log in.

I then copied the code to a master page in another solution, but  there the popup will not display.  When you click on the login link, the cursor goes to the right method and goes through it without  error, but the popup never shows. Herer's the code:

public partial class Main_MasterPage : System.Web.UI.MasterPage
{
    public string odometervalue;
    //public string odocurrentvalue;
    protected void Page_Load(object sender, EventArgs e)
    {
        stats st = new stats();
        odometervalue = st.getbdtotals();

        ContentPlaceHolder cph1;

        Literal l1;
        cph1 = (ContentPlaceHolder)this.Page.Master.FindControl("ContentPlaceHolder1");
        if (cph1 != null)
        {
            l1 = (Literal)cph1.FindControl("Literal1");
            l1.Text = odometervalue;
        }
    }

    protected void LinkLogin_Click(object sender, EventArgs e)
    {
        pLogin_ModalPopupExtender.Show();
    }

    protected void Login1_LoggedIn(object sender, EventArgs e)
    {
         TextBox userName = (TextBox)Login1.FindControl("UserName");
        string uname = userName.Text;
        TextBox Password = (TextBox)Login1.FindControl("Password");
        if (Membership.ValidateUser(userName.Text, Password.Text) == true)
        {
            CheckBox rememberMe = (CheckBox)Login1.FindControl("RememberMe");

            bool PersistMe = rememberMe.Checked;

            rider bd = new rider();

            string UserData = bd.getRidFromUsername(uname).ToString();
            
            FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, uname, DateTime.Now, DateTime.Now.AddMonths(3), false, FormsAuthentication.FormsCookiePath);
            string encryptedTicket = FormsAuthentication.Encrypt(ticket);
            HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);
            if (PersistMe == true)
                authCookie.Expires = DateTime.Now.AddMonths(3);//make sure its same as the formsauthentication ticket expiry value

            Response.Cookies.Add(authCookie);
            rider rd = new rider();
            int albumid = 0;
            if( ! rd.albumexists(Convert.ToInt32(UserData),"Profile" , 1 ))
                rd.createalbum(Convert.ToInt32(UserData), "Profile", 1, albumid);
            Response.Redirect("~/Main/Home.aspx");
        }
    }

and the design code:

<head runat="server"><title>Big Dogs</title><asp:ContentPlaceHolder id="head" runat="server"><link href="../Content/main.css" rel="stylesheet" /><link href="Content/Site.css" rel="stylesheet" /></asp:ContentPlaceHolder></head><body><form id="form1" runat="server"><asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager><%-- <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>--%><link href="../Content/CSS.css" rel="stylesheet" /><script src="../Scripts/Extension.min.js"></script><link href="../Content/odometer-theme-car.css" rel="stylesheet" /><link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css"><style>
.odometer {
  font-size: 40px;
}</style><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script><script src="../Scripts/odometer.js"></script><div><div class="mypages"><%--<div style="background-color:gainsboro; height:20; float:right; padding-right:px; ">--%><section id="login"><asp:LoginView ID="LoginView1" runat="server" ViewStateMode="Disabled"><AnonymousTemplate><ul><li><a id="registerLink" runat="server" href="~/Account/Registrar.aspx">Register</a></li><li><asp:LinkButton ID="LinkLogin" runat="server" Text="Log in" OnClick="LinkLogin_Click" /></li></ul></AnonymousTemplate><LoggedInTemplate><p><asp:Label ID="lGreeting" runat="server" /><a id="A1" runat="server" class="username" href="/Profile/myProfile.aspx" title="Manage your account"  >View My Profile<%--<asp:LoginName runat="server" CssClass="username" />--%></a>!<asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LogoutText="Log off" LogoutPageUrl="~/Account/LOGOUT.aspx" /></p></LoggedInTemplate></asp:LoginView></section><div><div></div><div style="width:1000px; margin-top:25; padding-top:10px" ><asp:Image ID="imglogo" runat="server" ImageUrl="~/Images/Site/doglogomain.png" /><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BDUCConnectionString %>" SelectCommand="adminRiderInfo" SelectCommandType="StoredProcedure"><SelectParameters><asp:Parameter Name="riderid" Type="Int32" /></SelectParameters></asp:SqlDataSource></div><asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Icons/user_silhouette.png" /><asp:HyperLink ID="hlToday" runat="server" Text="Today's Posts" Font-Size="Large" NavigateUrl="~/Main/todaysPosts.aspx" ToolTip="Who's Riding?" /><asp:Image ID="Image2" runat="server" ImageUrl="~/Images/Icons/medal_bronze_1.png" style="margin-left:10px;" /><asp:HyperLink ID="hlstndings" runat="server" Text="Leaderboard" NavigateUrl="~/Main/leaderboard.aspx" Font-Size="Large" /><asp:Image ID="Image3" runat="server" ImageUrl="~/Images/Icons/ccLogoicon.png" style="margin-left:10px;" /><asp:HyperLink ID="hlcc" runat="server" Text="Century Challenge"  CssClass="th" Font-Size="Large" NavigateUrl="~/Main/centuryChallenge.aspx" /><asp:Image ID="Image4" runat="server" ImageUrl="~/Images/Icons/blueprint.png" style="margin-left:10px;" /><asp:HyperLink ID="lnklgs" runat="server" Text="Logbook"  CssClass="th" Font-Size="Large" NavigateUrl="~/Main/Posts.aspx" /><br /><hr /></div><asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder></div><asp:Panel ID="pLogin" runat="server" CssClass="gainsPanel" style="display:none" ><asp:Login ID="Login1" runat="server" Width="225px" OnLoggedIn="Login1_LoggedIn" OnLoginError="Login1_LoginError" BackColor="White"  ><LayoutTemplate><table  style="border-collapse:collapse; padding:1px;"><tr><td><table ><tr><td style="text-align:center" colspan="2"><%--<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>--%><strong>Log In</strong></td></tr><tr><td class="tdreq"></td><td class="tdlt_150"><asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label><br /><asp:TextBox CssClass="txlt_150" ID="UserName" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="ctl00$Login1" /></td></tr><tr><td class="tdreq"></td><td class="tdlt_150"><asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label><br /><asp:TextBox ID="Password" runat="server" TextMode="Password" CssClass="txlt_150" /><asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="ctl00$Login1" /><%-- <ajaxToolkit:ValidatorCalloutExtender ID="PasswordRequired_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="PasswordRequired"></ajaxToolkit:ValidatorCalloutExtender>--%></tr><tr><td colspan="2"><asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." /></td></tr><tr><td align="center" colspan="2" style="color:Red;"><asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal></td></tr><tr><td class="" colspan="2"><asp:Button ID="Button1" runat="server" Text="Cancel" />&nbsp;<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In"   /></td></tr></table></td></tr></table></LayoutTemplate></asp:Login></asp:Panel><asp:Button ID="btnpop" runat="server" Text="Button" style="display:none" /><asp:ModalPopupExtender ID="pLogin_ModalPopupExtender" runat="server" Enabled="True" CancelControlID="Button1" OkControlID="LoginButton" TargetControlID="pLogin" PopupControlID="btnpop" /><</div></form><script>
        setTimeout(function () {
            var uid = '<%=odometervalue  %>';$('.odometer').html(uid);
    }, 1000);</script></body></html>

Ajax error in VS 2008

$
0
0

I have a page that uses update panel. There are a couple of cascading drop down list and a button. When I make my selections in the drop downs and click Submit button I get :

"Error: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format."

I set enablePartialRendering to false to see if I can get the actual error but I just get another JS error, this time:

"Error: Unable to get property 'add_pageLoaded' of undefined or null reference"

The compiled code works fine when accessed through a browser (or is it suppressing the error display?)

Need help with maintaining ‘Scroll Position after Asynchronous Postback’ using AJAX

$
0
0

I am trying to maintain the ‘Scroll Position after Asynchronous Postback’ with the following piece of code

<script type="text/javascript">
    var xPos, yPos;
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_beginRequest(BeginRequestHandler);
    prm.add_endRequest(EndRequestHandler);
    function BeginRequestHandler(sender, args) {
        xPos = $get('scrollDiv').scrollLeft;
        yPos = $get('scrollDiv').scrollTop;
    }
    function EndRequestHandler(sender, args) {$get('scrollDiv').scrollLeft = xPos;$get('scrollDiv').scrollTop = yPos;
    }</script>

I got this code from this link: http://weblogs.asp.net/andrewfrederick/maintain-scroll-position-after-asynchronous-postback

I practically have tried everything but the code is still no working. To my surprise it is working for many people according to the link. What is it that I am doing wrong? I do have master page. Does it works with master pages? I am assuming that the ‘scrollDiv’ in the code is the ID of an Div element in the page. So, I may change it to a label, div, panel, or any other control ID. Am I right?

Please help. Thanks


What are the Causes of 500 Internal Server Error

$
0
0

Hi all, I am trying to send an image with a content-type of  multipart/form-data to a webservice but got a 500 Internal Server Error. The following is my Javascript function to send the image and receive a status message from the webservice.

                 xhr = new XMLHttpRequest();
                 xhr.open('post', 'http://localhost:26692/SavePicService.asmx?op=SaveImage', true);
                 //xhr.setRequestHeader('Content-Type', "multipart/form-Data");
                 xhr.setRequestHeader('Content-Type', "application/x-www-form-urlencoded");
                 xhr.setRequestHeader('X-File-Name', file.fileName);
                 xhr.setRequestHeader('X-File-Size', file.fileSize);
                 xhr.setRequestHeader('X-File-type', file.fileType);

                 xhrObj.send(file);

                 var responseObject = xhr.responseText;
                 alert(responseObject); // ------- Test status of upload

This is a simple webserivce to test if data is successfully being received and response is sent back by webservice.

namespace myNameSpace
{
    /// <summary>
    /// Summary description for SavePicService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [System.Web.Script.Services.ScriptService]
    public class SavePicService : System.Web.Services.WebService
    {

        [WebMethod]
        public string SaveImage()
        {           

            return "Data Transfer Successful!";
        }
    }
}

At first my content-type was set to "multipart/form-Data" in my javascript upload function but I got the 500 internal service error. After doing some digging online I came across an article that says that the content-type must be set to "application/x-www-form-urlencoded" or the 500 internal server error will be thrown. Needless to say, that still results in the same error.  Please point out where I went wrong in my code, thanks in advance.

is it posible to use jquery in ajax slideshow?

$
0
0

Hi,

I have a database,A Web Service retrieve images from database and Display on Ajax SlideShowExtender,

Now I want to use jquery for slideshow, I want to create a beautiful effects to change my slides, (those images retrieved from database).

Ajax SlideShowExtender has few effects but they are not beauty.

Is it possible to use jquery in Ajax slideshow Extender ?????????? 

Plz HELP me,

THANKS.

Two Timer control in the same page

$
0
0

 Hi all,

I use new asp.net Ajax V1.

I would like to put on my page two Timer Control.

But When my UpdatePanel1 is updated, my second part is emptied. Then my updatePanel2 is updated my first part is emptied

<div id=result_box dir=ltr>Have an idea to prevent that my updatePanel is emptied ?</div>

In my page aspx

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

<asp:Timer runat="server" Interval="20000" ID="TimerControl1" OnTick="tickerTimer1_Tick" />
<asp:UpdatePanel runat="server" ID="UpdatePanel1" RenderMode="Block"   >      
    <Triggers>
        <asp:PostBackTrigger  ControlID="TimerControlMessage"/>   
    </Triggers>
    <ContentTemplate>
        my firt part : label
    </ContentTemplate>
</asp:UpdatePanel>


<asp:Timer runat="server" Interval="30000" ID="TimerControl2" OnTick="tickerTimer2_Tick" />
<asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Always" RenderMode="Inline" >
   <Triggers>
       <asp:AsyncPostBackTrigger ControlID="TimerControl2" EventName="Tick" />
   </Triggers>
   <ContentTemplate>      
       my second part : gridview           
  </ContentTemplate>
</asp:UpdatePanel>

 In my code behind C#

protected void tickerTimer1_Tick(object sender, EventArgs e)
{
    //update only my firt part
}

protected void tickerTimer2_Tick(object sender, EventArgs e)
{
    //update only my second part (only my gridview)
}

Thank you for your help.
Cheers.

Textbox transform in Select Dropdown based on closest div when function onchanged trigger at one of the field; option failed populated

$
0
0

Hi All,

The textbox name: q able to transform become select field when some function trigger. But, I failed to populate the option into the new select field. How can I do that?

Something wrong with this code:

var options = $(this).closest('div').find("select[name^='q']");//what should I need to do here???

var plazosHtml = "";
                var controller = $(this).val().split('.')[0];
                var html = "<select id='q' name='q'></select>";$(this).closest('div').find('#q').replaceWith(html);$.ajax({
                    url: '@Url.Content("~/Admin/CurrencyList/")',
                    type: 'POST',
                    dataType: 'json',
                    success: function (data) {
                        var options = $(this).closest('div').find("select[name^='q']");//what should I need to do here???$.each(data, function () {
                            //alert(this.Description); // came from .NET Dictionary's Key Value pair
                            options.append($('<option />').val(this.CurrID).text(this.Description));
                        });
                    }
                });

            } else {
                var html = "<input type='text' size='30' id='q' name='q' class='qsbox' />";$(this).closest('div').find('#q').replaceWith(html);
            }

Please advise.

Regards,

Micheale

AJAX Tab Control problem on asp.net form

$
0
0

hello good people,
i have created a tab control and added a gridview in it. When i run it this is how it shows:

[IMG]http://i59.tinypic.com/2i1koww.png[/IMG]

i have tried adjusting the heights and widths of both but to no avail. here is my code:

<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
                        Height="421px" style="z-index: 1; left: 212px; top: 271px; position: absolute" 
                        Width="933px"><ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="Neurology"><ContentTemplate><asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                                    AutoGenerateColumns="False" DataSourceID="Neuro" 
                                    style="z-index: 1; left: 242px; top: 367px; position: absolute; height: 309px; width: 870px" 
                                    AllowPaging="True"><Columns><asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /><asp:BoundField DataField="Designation" HeaderText="Designation" 
                                            SortExpression="Designation" /><asp:BoundField DataField="Qualification" HeaderText="Qualification" 
                                            SortExpression="Qualification" /><asp:BoundField DataField="Shift" HeaderText="Shift" SortExpression="Shift" /><asp:BoundField DataField="Appointment_Timings" 
                                            HeaderText="Appointment_Timings" SortExpression="Appointment_Timings" /></Columns></asp:GridView><asp:SqlDataSource ID="Neuro" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                                    SelectCommand="SELECT * FROM [Neurology]"></asp:SqlDataSource></ContentTemplate></ajaxToolkit:TabPanel><ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Cardiology"></ajaxToolkit:TabPanel><ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="Dermatology"></ajaxToolkit:TabPanel><ajaxToolkit:TabPanel ID="TabPanel4" runat="server" HeaderText="Opthalmology"></ajaxToolkit:TabPanel></ajaxToolkit:TabContainer>

Help needed ASAP please!

Viewing all 5678 articles
Browse latest View live




Latest Images