Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Wednesday, March 28, 2012

Multiple Popup Controls in PopupControlExtender

This is the code i have.

<atlasToolkit:PopupControlExtenderID="PopupControlExtender1"runat="server">

<atlasToolkit:PopupControlPropertiesPopupControlID="Panel1"Position="Bottom"TargetControlID="txtFrom"/>

<atlasToolkit:PopupControlPropertiesPopupControlID="Panel1"Position="bottom"TargetControlID="txtTo">

</atlasToolkit:PopupControlProperties>

</atlasToolkit:PopupControlExtender>

I get the following error message. But, if i remove one of the popupcontrols it works fine. AtlasControlToolkit version is 1.0.60914.0. What am i doing wrong.

Couldn't get extender properties on extender PopupControlExtender1. Make sure the ID is spelled correctly and the control is on the page.

Please include the complete error information and post a complete, simple sample page if you could.

Monday, March 26, 2012

MultiRequestHandler removing FORM POST parameters

Hi,


My page can not find any parameters sent using the POST methed when the following ATLAS code is contained in the web.config file:

<!-- The MultiRequestHandler enables multiple requests to be handled in one roundtrip to the server. Its use requires Full Trust.-->
<add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/>
<add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>
<add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>

All GET parameters are not effected.

Does anyone know how I can resolve this?

Regards

Parlster

Got it.

I misinterpretated the issue.

POST variables are removed when the Session state management is set to Cookieless:

<sessionStatecookieless="true"/>

The lost variables can be found by using GET submission or using Cookies to manage the Session:

<sessionStatecookieless="AutoDetect"/>

Regards

Parlster

Multiview inside updatepanel, Firefox error on refresh

Hi, I got this piece of code:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableEventValidation="true"%><%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!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"> <title>Untitled Page</title></head><body> <form id="form1" runat="server">  <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>     <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex=0> <asp:View ID="View1" runat="server"> aaa<asp:Button ID="Button1" CommandName="NextView" runat="server" Text="Next" /></asp:View> <asp:View ID="View2" runat="server"> bbb<asp:Button ID="Button2" CommandName="PrevView" runat="server" Text="Prev" /> bbb<asp:Button ID="Button4" CommandName="NextView" runat="server" Text="Next" /></asp:View> <asp:View ID="View3" runat="server"> ccc<asp:Button ID="Button3" CommandName="PrevView" runat="server" Text="Prev" /></asp:View> </asp:MultiView> </ContentTemplate> </asp:UpdatePanel> </form></body></html>

So basically it's just a multiview inside an updatepanel. It works when used properly, but in FireFox (not in IE and Opera), I get a little error. Say on the first view, I press next. Then I refresh the browser. Unlike when there's no update panel, the view resets to the first view. [This is not the MAIN problem, but help here would also be welcome].

Now, after the refresh if I press next, I get this error in FireFox(again, not in IE or Opera):

The state information is invalid for this page and might be corrupted.

Could someone give me a fix for this problem? I'd also like to know if it's possibe to retain the view on refresh instead of it resetting to the first one.

Thanks.

I copied your multiview and ran it, it works fine for me under FireFox 2.0.0.1

The only different is that my scriptmanager containsEnablePartialRendering="true"

Try it again or create a new Ajax WebSite for testing ... Good Luck.


Hi,

Thanks for the reply. However, I just can't get it to work. I created new ajax enabled sites (both on file system and IIS, thinking maybe it's an IIS setting), didn't help. I'm running 2.0.0.1 of FF - the same as you.

Could you try

www.funkybears.com/test.aspx

On the first page, hit next. Then use the refresh button of firefox. Click next after the page loads. I'm getting the error right then.

Also, if I don't use an update panel, if I hit refresh, the currently selected view shows up. With the updatepanel, it always returns to the first view. Is there a way to counter this?

Thanks.


Bump :)
I tried your URL, it works fine under both browser IE7 and FF.

multiview requiredfieldvalidator and updatepanel error - entire simple code posted

Problem is when I click on linkbutton2 then click on the button on that page is get the null error. It's being caused because it's looking for the validator from view1.

I know I can say causesvalidation=false, but I will have tons of items in view2 and don't want to do it that way.

I want to say RequiredFieldValidator1.enabled=false for the view2 section. But where do I call this? Also when they go back to view1 it should say this RequiredFieldValidator1.enabled=true.

code behind:

Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
MultiView1.ActiveViewIndex = 0
End Sub

Protected Sub LinkButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
MultiView1.ActiveViewIndex = 1
End Sub

source:

<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<atlas:UpdatePanel runat="server" ID="calendarupdatepanel">

<ContentTemplate>

<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" CausesValidation="false">Search</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButton2_Click" CausesValidation="false">Results</asp:LinkButton>
<br />
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="view1" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
</asp:View>
<asp:View ID="view2" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" />
</asp:View>
</asp:MultiView>
<asp:Label id="ActiveViewLabel"
BorderStyle=None
Font-Size=Small
BackColor="#ffff66"
runat="Server" Text="" >
</asp:Label>
</ContentTemplate>
</atlas:UpdatePanel>

</form

fixed this one - never mind

My Calendar doesnt like Saturdays... :((

This is the code for one of the two calendars I have on my page:

<cc1:calendarextenderid="calex_txtStartDate"runat="server"TargetControlID="txtStartDate"PopupButtonID="calendarIconStartDate"></cc1:calendarextender>

My problem is that neither of these calendars wants to display Saturdays. :( I searched through the other posts, but they all mention UpdatePanels, none of which I have. The only containers I have this in are an asp:Content and a standard HTML <div>.

Thanks!

FYI: It is a cell padding issue, easily fixed (as it turns out) with CSS.

My Calendar (AJAX asp.net) get NUTS? Only shows 5 days, instead of 7 days

Hi,

the problem is that my calendar shows only 5 days instead of 7 days. Any IDEAS? There is no (code-behind) code in CS file that does hide weekend.

here is a code

<asp:TextBox runat="server" ID="TBsearchFrom" Columns="10" />
<asp:TextBox runat="server" ID="TBsearchTo" Columns="10" />
<ajaxToolkit:CalendarExtender ID="cldFrom" runat="server"
TargetControlID="TBsearchFrom"
CssClass="MyCalendar"
Format="MM/dd/yy"
OnClientDateSelectionChanged = "function(e){calendar_hide(e);}"
FirstDayOfWeek="Monday"

/>
<ajaxToolkit:CalendarExtender ID="cldTo" runat="server"
TargetControlID="TBsearchTo"
CssClass="MyCalendar"
Format="MM/dd/yy"
OnClientDateSelectionChanged = "function(e){calendar_hide(e);}"
FirstDayOfWeek="Monday"
/>
<br/>


I had this same issue. The problem was that the calendar was picking up on CSS set for my site, which didn't have the right padding for each of the calendar's components. What I did was copy the calendar's padding properties in the CSS from the example in the toolkit and paste it into my CSS file, and customized the colors from there.

Hi there,

I am having the same kind of problem, my calendar control is contained within a detailsview. I have added the css to look like this

.MyCalendar.ajax__calendar_container {

border:1pxsolid#646464;

background-color:#ffffff;

color:#000000;

}

.MyCalendar

.ajax__calendar_footer {border-top:1pxsolid#f5f5f5;

}

.MyCalendar

.ajax__calendar_dayname {border-bottom:1pxsolid#f5f5f5;

}

.MyCalendar

.ajax__calendar_day {border:1pxsolid#ffffff;

}

.MyCalendar

.ajax__calendar_month {border:1pxsolid#ffffff;

}

.MyCalendar

.ajax__calendar_year {border:1pxsolid#ffffff;

}

.MyCalendar

.ajax__calendar_active.ajax__calendar_day {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;

}

.MyCalendar

.ajax__calendar_active.ajax__calendar_month {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;

}

.MyCalendar

.ajax__calendar_active.ajax__calendar_year {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;

}

.MyCalendar

.ajax__calendar_other.ajax__calendar_day {background-color:#ffffff;border-color:#ffffff;color:#646464;

}

.MyCalendar

.ajax__calendar_other.ajax__calendar_year {background-color:#ffffff;border-color:#ffffff;color:#646464;

}

.MyCalendar

.ajax__calendar_hover.ajax__calendar_day {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;

}

.MyCalendar

.ajax__calendar_hover.ajax__calendar_month {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;

}

.MyCalendar

.ajax__calendar_hover.ajax__calendar_year {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;

}

.MyCalendar

.ajax__calendar_hover.ajax__calendar_title {color:#0066cc;

}

.MyCalendar

.ajax__calendar_hover.ajax__calendar_today {color:#0066cc;

}

But whenever I open the calender I am only presented with 8 days of the month (the 1st 4 and last 4) I think its a padding issue but I dont know what else to change


Never mind my last post.

But if anyone is having the same problem all you need to do is add some extra css for the body of the calendar.

In my case I had mine within a td

.MyCalendar

td

{

padding:0px,0px,0px,0px;border-spacing:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;

}

Saturday, March 24, 2012

My UpdatePanel does not work

Hi,

I am trying to use Updatepanel, but it does not work. The whole page is refresh it. What am doing wrong??

That is the code : (am using a master page)

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder2"Runat="Server">

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true">

</asp:ScriptManager>

<tablestyle="width: 600px;"id="TABLE1"align="center">

...............................................................

<asp:UpdatePanelID="UpdatePanel1"runat="server">

<ContentTemplate>

<cc1:MaskedEditExtenderID="MaskedEditExtender1"TargetControlID="tbCuentaBancaria"Mask="9{4}-9{4}-9{2}-9{10}"runat="server">

</cc1:MaskedEditExtender>

<tr><tdcolspan="4">

<asp:CheckBoxID="cbCuentaBancaria"runat="server"Text="No tengo cuenta bancaria"OnCheckedChanged="cbCuentaBancaria_CheckedChanged"AutoPostBack="True"/></td></tr>

<trstyle="height: 35px;">

<tdstyle="width: 176px"><asp:LabelID="Label4"runat="server"Text="Entidad Bancaria*"Width="110px"></asp:Label></td>

<tdstyle="width: 393px"><asp:TextBoxID="tbNombreBanco"runat="server"></asp:TextBox></td>

<td><asp:LabelID="Label5"runat="server"Text="Cuenta Bancaria*"></asp:Label></td>

<td><asp:TextBoxID="tbCuentaBancaria"runat="server"></asp:TextBox></td>

</tr>

</ContentTemplate>

</asp:UpdatePanel>

..............................

</asp:Content>

To useUpdatePanel controls with master pages, you can put aScriptManager control on the master page. In this scenario, the master page provides aScriptManager control for every content page.

Check UpdateMode property of UpdatePanel, whether it is set to "Conditional" or not ?

See for more details...

http://ajax.asp.net/docs/tutorials/UsingUpdatePanelMasterPages.aspx


Thanks,

I moved the ScripManager to the Master Page but nothing happen. I have modified a little the code inside the UpdatePanel and now is working. i think it was a problems with the tr and td structure.

Need code for Drag and Drop Div ...

Hello All...

i have two tables where i have 3 div in 1 one table and 3 Divs in other table.

i want that i can drag any DIV of 1st tables DIV to 2nd TABLES Div and can paste on it..

i went to several solutions but they are providing solutions for HardCord Named DIVS not for Runtime Created DIVs.

pls help me...

It shouldn't work any differently. You just need to assign IDs to the divs when you create them and then assign the behaviors to those IDs. Perhaps if you post the code you are using to create the divs as well as what solution you want to use (I personally like the prototypes at http://script.aculo.us).


Yes. Check these sample for clues

http://www.codeproject.com/aspnet/DragAndDropShopping.asp

http://elouai.com/javascript-drag-and-drop.php

HTH,
Suprotim Agarwal

--
http://www.dotnetcurry.com
--


i am basically creatingDIV dynamically through CODE and i want to paste them on each other

i am not getting any help from http://script.aculo.us site and other answers of my post forums

How can i assign values & Ids of different DIV created at runtime in my JavaScript ?? can u give me a sample code ...

Thank You


var parent = document.getElementById('parentDiv');
var newdiv = document.createElement('div');
var divID = 'myNewDiv;
newdiv.setAttribute('id',divID);
newdiv.innerHTML = 'Element has been added!';
parent.appendChild(newdiv);


http://www.dhtmlgoodies.com/index.html?page=dragDrop

Need help - Message: The remote host closed the connection. The error code is 0x80072746.

Message: The remote host closed the connection. The error code is 0x80072746.
Source: App_Web_xgkqs8rx
Offending URL:http://abc/asp.aspx
Stack trace: at MasterPage.MasterScriptManager_AsyncPostBackError(Object sender, AsyncPostBackErrorEventArgs e) at System.Web.UI.ScriptManager.OnAsyncPostBackError(AsyncPostBackErrorEventArgs e) at
System.Web.UI.PageRequestManager.OnPageError(Object sender, EventArgs e) at
System.Web.UI.TemplateControl.OnError(EventArgs e) at System.Web.UI.Page.HandleError(Exception e) at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest() at
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at
System.Web.UI.Page.ProcessRequest(HttpContext context) at
ASP.searchrequestasi_aspx.ProcessRequest(HttpContext context) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Can't duplicate this error - how do i find out exactly what's going on?

I have a session object that I am supplying the results of the grid to.

I also have<pagesenableViewState="true"validateRequest="false"viewStateEncryptionMode="Never"

enableViewStateMac="false"enableSessionState="true">

Found the problem. When they hit the button to search, it waits for the results. Then they can click on the button multiple times before the results come - or before the onclick event is even fired.

How can i disable the button - then reenable it when they get data?


I disabled the button - but it doesn't go through with the submit - how can i make it go throught with the submit even after the button is disabled?

It's in an updatepanel.

Dim x As String = "document.getElementById('ctl00$cphBody$btnSearch').disabled = true;"

btnSearch.Attributes.Add("onclick", x)

If you're using UpdatePanel, here is what you can do:

Please wait...

If your async call is not caused by an UpdatePanel, let me know and I'll show you how to handle the "async complete event" which will re-enable the button...


Awesome that worked. What does $get do? Do you have a tutorial on that?


$get('elementid') is the same asdocument.getElementById('elementid')

You can learn more here:

http://ajax.asp.net/docs/ClientReference/Global/default.aspx

If this solves your issue, please mark this thread as "Resolved".

Good luck!Wink


Problem it loads pleasewait - even if it doesn't pass the requiredfieldvalidator. So if i leave it blank then click - it says pleasewait - but i can't reenter the number and click on the button.
Figured it out -

if (Page_ClientValidate() == true)


Well, in this case you can do the following:


I want to put the processing status in the status bar when they click button. Which I did with window.status='Processing'. But I want it to go away or be blank when the search results are displayed. Any ideas?

Instead of the below - can i show this in the status bar instead?

<atlas:UpdateProgressID="Progress1"runat="server"DynamicLayout="true">

<ProgressTemplate><asp:ImageID="Image1"runat="server"SkinID="Indicator"/> Processing...</ProgressTemplate>

</

atlas:UpdateProgress>

Here is how you can accomplish this:

May be you should start a new thread so that other people may benefit from its title.Wink

Wednesday, March 21, 2012

Need help with Catpcha!

Hello,i have a problem with my registration page.i need 2 put in captcha.i put in a code which worked fine till i was using asp.net.but now when i have switched 2 asp.net ajax the captcha image doesn't get displayed anymore.after going thru sum forums i was told dat its cuz the captcha program needs a postback or sumthing(i'm a new to this) which ajax doesn't do so dats y its not working.wat i need is a captcha code dat wud work with asp.net ajax for my registration page.Pls help me!!!!!!Thank you in advance!!

There is aNoBot control in the AJAX Control Toolkit; also check out this:http://ajaxwidgets.com/Blogs/thomas/create_an_ajax_captcha_control.bb

-Damien


hey thanx a lot 4 the quick reply.i din't wanna use NoBot cuz it said dat its only 4 site with low traffic n dats not the case i'm in rite now. So I decided 2 go 4 the ling u gave me n thats working wonderfully.Thanx Dwhite.

bennysachdev:

So I decided 2 go 4 the ling u gave me n thats working wonderfully. Thanx Dwhite.

Glad that helped, please mark my post as the answer.

Thanks!
-Damien

Need help with implementing a pattern for asynchronous requests/responses in a loop

Here is the pseduo code for what I need to do:

Get URL
For each element in XML file (currently 8)
Extract URL
Get URL
For each element in XML file2 (between 1 and 8)
Extract URL
Get URL
For each element in XML file3 (between 1 and 10)
process elements
Loop
Loop
Loop

I could easily do this using synchronous xmlhttp calls, but I am also trying my best to avoid that. The problem is that I can't think of a clean way to do this using asynchronous calls. Can any one assist with a pattern that would do this?

Cheers,

Scott

P.S. This needs to be done on the client as I am not willing to use my own server here. Although, I have considered something like Yahoo! Pipes or Microsoft's PopFly to mash this information up for me.

Hi,

Thank you for your post!

As far as I know, there is no built-in support for this usage in MS AJAX 1.0/3.5.

I think the most flexible way to do it is to use directly synchronous xmlhttp calls.

If you have further questions,let me know.

Best Regards,

Need help with passing params to server

Hello,

I'm new in Ajax and perhaps you can help me. Here is a very simplified code of my application

default.aspx:

<

formid="form2"runat="server">

<

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

<

asp:UpdatePanelID="UpdatePanel1"runat="server"></asp:UpdatePanel>

<

asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>

<

asp:AutoCompleteExtenderID="AutoCompleteExtender1"runat="server"ServiceMethod="GetResult"ServicePath="WebService.asmx"TargetControlID="TextBox1"/>

</

form>

default.aspx.cs:

protected void Page_Load(object sender, EventArgs e)

{

for (int i = 0; i < 5; i++)

{

LinkButton lb = new LinkButton();

lb.ID = i.ToString();

lb.Text = i.ToString();

UpdatePanel1.ContentTemplateContainer.Controls.Add(lb);

base.CreateChildControls();

}

}

And in WebService.asmx I need a service for AutoCompleteExtender that will return result depending on what LinkButton was pressed.

As far as I understand, there is no direct way to pass additional params to server with AutoCompleteExtender.

But perhaps there are other ways?

For example, can creating of a new custom control or using Sessions help?

You can pass additional params as querystring to the server.

ex:

AutoComplete.asmx?KEY=2

To retrieve the value in webserver use

HttpContext

.Current.Request.Params["KEY"]

This option was working with ATLAS but now its not working with Ajax 1.0