Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Wednesday, March 28, 2012

Update to Beta 2.0 and can not run on Server

I have recently upgraded my Web Page to use the new AJAX 2.0 beta. I have also included the November CTP. This works fine on my local PC, but when I run it on my Server, it blows up.

I had initially included all of my DLL's in the Bin folder. After reading many of the posts, I decided to install the ASPAJAXExtSetup.msi and ASPAJAXCTP.msi onto my server. No joy.

I get the following error message:

Server Errorin'/EDCC_Test' Application.------------------------Index was outside the bounds of the array. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack tracefor more information about the error and where it originatedin the code. Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identifiedusing the exception stack trace below. Stack Trace: [IndexOutOfRangeException: Index was outside the bounds of the array.] EDCC.PageBase.curUser() +687 File_Home.Page_Load(Object sender, EventArgs e) +92 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061 ------------------------Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

I am not sure where to start debugging this code. As I stated above, it works fine on my machine, but not from the server.

Can someone help point me in the correct direction? Is there a way to "Debug" the page from the server side like from within Visual Studio? Maybe allowing me to "step" through the code? Is there a way to show a more verbose error message that will point me in a better direction?

Thanks,

Bryan

PS: Before I upgraded my site to the Beta 2.0, it was running fine. (Thank goodness I had the foresite to try to install it onto a "test" site before making it live.) Big Smile

hello.

well, it looks like you're passing an index too big for an array.

to see how to get more info about the error on an asp.net, take a look at the <customerrors> element.


Hello,

I agree with Luis. I mean i'm not completely sure that by upgrading you broke something. You probably have a dropdownlist or maybe an array that isn't getting data put into it. What does your code look like? What does the data access layer look like?

Not sure of any way to actually do debugging on the server like you can in the VS2005 IDE, unless you can recreate the environment on your local machine (Database, Web Application etc.)

VS2005 Team System Developer includes the ability to do unit tests. This allows for you to actually step through your code and make sure that all of the pieces are logical and you don't have issues that would show up until you actually loaded up the website onto the server and tested.

Good luck and happy thanksgiving.

JoeWeb


Thanks all for your replies.

I figured out my problem by republishing a million times with different "Response.Write" and "Response.End" statements until I found the error.

I am developing an Intranet site, and I rely on the Windows user name to authenticate. When I created a "test" web site on my server, I had the "Allow Anonymous Logins" box checked somewhere in the properties. Once I removed this, it worked flawlessly. Jeesh, newbie mistake.

Bryan

Update UpdatePanel contents from a web method async call back

Hi,

I have several asp label controls contained in an UpdatePanel.

An asp button control has code behind that calls a web service method using an AsyncCallBack.

When the callback occurs, I need to show the results by setting the text property on the label controls but I cant get the label controls to update.

Does anyone know how to get this working??

Thanks,

Hi, not much use to you I'm afraid but I have a very similar problem. My callback event is from a remoting object rather than a web service and I need to update a gridview rather than text boxes.The callbacks fire at irregular intervals so I can't use a timer to generate a partial postback.

Thanks


Well, you can't really force a client refresh based on a server-side event, unfortunately. The best you can do is use a timer of some sort, despite the fact that the response is irregular. Now, something to realize is that the updatepanel sends all the same form data that you'd normally send for a full postback, so that's a fairly heavy way to do it when you're not sure if you need to or not.

What I'd do instead is have that AsyncCallBack's server-side 'on complete' handler update a variable at the appropriate scope (there's any number of choices to make there as to where to place that variable scope-wise, and what info it should contain; but those decisions are domain specific to your app). Anyway, do that and then set up a simple web service that provides a read-only view of that variable. Personally, I'd use a 'last updated' kind of thing, and have that in the update panel as well, that way you can compare the two times in the next step.

On the client side, create a simple script that fires at a set interval (again, whatever time is appropriate) using setTimeout or the Sys.Preview.Timer object (the latter being a lot easier to use, imo). That javascript function fires off a request to the web service you set up, and in its oncomplete handler, you check the response. If that variable's value indicates that a refresh is needed, then you have the javascript function initiate the updatepanel's asynch postback to refresh all the data.

Now, all that said, I probably would do the whole thing w/ web services myself, but I'm assuming that you need some of the major server-side features that the updatepanel technique allows you to use.

Hope that helps,

Paul

Updated Atlas info?

Wish Atlas guys had included the timestamp on this web page, so that one would know when it was updated last.

http://atlas.asp.net/docs/default.htm

Rightnow, I'm looking for the most uptodate (Dec 05) documentation & Hands-on labs for Atlas and I'm not sure if the above link is the right one.

-Rach

The Last-Modified HTTP Header indicates:

Mon, 19 Dec 2005 16:05:28 GMT

Plus the example for the AutoComplete stuff uses the new AutoCompleteExtender (http://www.nikhilk.net/Entry.aspx?id=100) stuff. So yes, it has been updated for this new build.

Updated to latest release - profile now broken

I just upgraded my web application to the latest release of Ajax and now the app hangs on the login. I paused the code and it is hanging on getting a profile property. I even tried creating an entierly new membership database and it still does the same thing. The Website Configuration Tool still connects to the membership database, so I know its not a problem with the users or roles. Any help would be greatly appreciated.

MORE INFO -

When I pause the app, it always stops on one of two lines:

The first is in a generated code file -

ReturnCType(Me.GetPropertyValue("LastName"),String)

This is what lead me to believe it is a profile issue - this generated code file has all of my profile properties in it. When I set a watch on Me.getPropertyValue("LastName"), its value is "Cannot evaluate expression because we are stopped in a place where garbage collection is impossible...etc"

If I start running and then pause again, it stops on a line that begins:

IfNotMy.User.IsInRole("Administration")

So, naturally I set a watch on My.User - which yields a value of "error: cannot obtain value"

I have NO IDEA what to do next? Anybody?

We upgraded to the latest version of the toolkit a few days ago, and now are seeing a lot of things either not working, or working sometimes and sometimes not. I almost suspect there is a problem in this version, but I cannot find the old version to go back to...

TIA,

Bill


Figured it out...had an error infinite loop going. Had nothing to do with membership.

UpdateMode = Conditional still refreshes!

I have a web application project running Atlas, now Ajax, with a masterpage where I have a scriptmanager.On the default page I have a scriptmanagerproxy and some usercontrols. these have updatepanels inside of them, all with updatemode=conditional and triggers for ONE button to make them refresh.

No matter which button I press, the updatepanel refreshes. It doesn't really flicker, the problem is that it refreshes the content. I've tried removing everything, I've even tried with a new website project, and with and without masterpages, no matter the result is the same.

Can someone please explain this to me? I use the web_ctp.config and run on win 2003 server. please let me know what code you require, though the very basics aren't even working, I don't see the point of posting any now.

Solution found here...

http://forums.asp.net/thread/1239062.aspx

UpdatePanel

hi,

i have web site in asp.net and i want ti use the ajax controls. i have changed my webConfig as it's described in http://www.asp.net/AJAX/Documentation/Live/default.aspx

my xml file webconfig has no error but when i add a updatepanel to an aspx page this make an error, the compiler can't identify the control.

please help me if u know waht is the problem.

thanks

Hi there

You also need to register the AJAX DLL in your web page at the top of your aspx file, e.g.


<%@. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %
Cheers

Mike


hi

i have added what you have mentioned Mikey65 and i can execute the aspx page now. but there is an other problem, the compiler underlined the ajax element in the pages as errors!

i dont now why?


Do you also have references to the web.extensions dlls in your project references??

Cheers

Mike


Hi,

DO u have this in ur web.config.

make the tag prefix name to some thing else then asp if this code in ur applications has it asaddtagPrefix="asp"

I have made it to ajax.

try this and it may work

<pagestheme="DefaultTheme">

<controls>

<addtagPrefix="ajax"namespace="System.Web.UI"assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</controls>

</pages>


<%@. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="ajax" %>

http://www.asp.net/AJAX/Documentation/Live/ConfiguringASPNETAJAX.aspx

Monday, March 26, 2012

UpdatePanel & ScriptManager Problem

Hi,I'm having a unusual problem I can see to solve. I'm new to AJAX and I'm finding fantastic.My problem is I have a user web control on a AJAX ASPX page with the ScriptManger.All the AJAX component work perfectly in the user web control except the following,

ScriptManager.RegisterClientScriptBlock(this,this.GetType(),"SearchMessage", msg,true);

The JavaScript is just a location.href or alert. I have no javascript errors I this is code in IFrame. Is there something different I need to do when accessing the script manager in the user web control?I can't find a solution and trying me crazy because I getting no errors and debugging tells me nothing.Really appreciate some help.thx

I sovled the problem so this thread is closed. I didn't realise I should of referenced the page above not the user web control class.

this.page instead of this

UpdatePanel & Form View in Web Site Project vs. Web Application Project

I am seeing two different behavour patters when using the UpdatePanel in a Web Application Project (File > Add New Project > ASP.NET AJAX-Enabled Web Application) vs a Web Site Project (File > New Website > ASP.NET AJAX-Enabled Web Site)

The exact same code will complie in one project type but not in another.

The code is:

<

asp:FormViewID="FormView1"runat="server"> <EditItemTemplate> <asp:UpdatePanelID="UpdatePanel1"runat="server"> <ContentTemplate> <asp:LabelID="Label1"runat="server"Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> </EditItemTemplate> <InsertItemTemplate> <asp:UpdatePanelID="UpdatePanel1"runat="server"> <ContentTemplate> <asp:LabelID="Label1"runat="server"Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> </InsertItemTemplate></asp:FormView>If you have this code in a single page Web Application Project it will complie and run just fine. However if you have this code in a Web Site Project it will not complete. It complains that you have already declared Label1 in this class. SInce Label1 is inside two different FormView templates this should complie.

Does anyone know a resolution for this other than converting to using Web Application Projects instead of Web Site Projects?

Thanks In Advance
Martin

p.s. Using most recient System.Web.Extensions downalod (1.0.61025.0)

Nevermind. The Web Application Project does not complete the aspx file so it does not fail until you try to run the code.

I guess its another issue as to why the UpdatePanel forces you to rename your controls differently within each template of the formview control.

Martin

UpdatePanel + Dynamically UserControl

Hi everybody.

I have next problem, I have a menu with a couple of options, when youclick over any option the web load a usercontrol inside of aupdatepanel (i save the virtualpath of the control in a viewstate), oneof these controls has a uptatepanel with a gridview.

The option which load the usercontrol is Customers, when I click thefirst time over Customers, the usercontrol and the gridview work fine,but if i click one more time over this option the gridview doesn'twork, I press to sort one column, but the gridview isn't updated, it islike it was frozen.

Thanks, Pedro.

I have exactly the same problem.

I'm not sure, but I think that this issue is related to the fact that the second updatepanel it's n loot loaded at page init, so it's not going to work properly.

If anybody has found a solution to get updatepanels to work after loaded dynamically, please HEELP!!

Saturday, March 24, 2012

Updatepanel and an external webform

I was wondering if anyone knows how to update a panel with an external web form. For example, I am trying to find out how to let users load and external asp web form into a asp panel using the ajax updatepanel. The users will click a button and the desired page will load within the updatepanel's pane. I would like to be able to update profile information within this pane. I've seen several example on how to update server information, but is it possible to load external editable web forms into the pane?

Can someone please give me a direction to work with?

You could load the external webform into an <IFRAME> and then wrap the UpdatePanel around that. I'm not sure if that would do what you want, but using an IFRAME is definitely one way of loading an external page into the current page.

<body>
<formid="form1"runat="server">
<asp:ScriptManagerID="ScriptManager1"runat="server">
</asp:ScriptManager>
<asp:UpdatePanelID="UpdatePanel1"runat="server">
<ContentTemplate>
<iframeid="iframe1"runat=serversrc="http://www.example.com/webform.aspx"></iframe>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>

Cheers,
Al

UpdatePanel and custom javascript.js files

Hi,

We are piloting Atlas for our web project and for the most part it works quite well. We are mainly using UpdatePanels to return validation details which need to be processed on the server based upon business rules.

The issue we have is to do with Atlas and our own custom javascript .js files which we include on some pages. When we include our .js files using the follwing syntax:

<script language="javascript" src=../js/hints.js></script>

We get a message box appear stating 'unknown error' under IE and no response under FireFox. If we paste the actual source code from the hints.js file into the aspx page like:

<script language="javascript" src=../js/hints.js>
function(page, name)
{
window.open(page, name);
return
}
</script>

Everything works fine. The partial postback works returning any validation error messages. This is in both IE and FireFox.

This poses a problem for us as we have a standard template of .js files which we include on every page via an include.htm file.

Since Atlas uses javascript, do we have to include our own custom scripts a special way, or is this a bug with Atlas at the moment?Hi,

a couple of suggestions:

1. you should add the type attribute for a script element: <script type="text/javascript" /> Atlas does some of its stuff by searching for the type attribute, so you may experience problems if you omit it.

2. enclose an attribute's value in double quotes: src="http://pics.10026.com/?src=../js/hings.js"

3. Do not put the script element in the <head /> section of the page when using Atlas.

4. Use the Page.ClientScript API if you are going to inject client script blocks in the page.

5. If you want to keep everything in one place, add a reference to your custom script in the Scripts section of the ScriptManager control.

UpdatePanel and Dynamic Controls...

Hello all,

I have created a *.ascx (UserControl) which I added in the web form in UpdatePanel dynamically using Page.LoadControl function. The control is rendered fine. But the client side event handlers (that I defined in the javascript of the UserControl) are not rendered. When that event is raised, it raises the "Object Required" javascript exception. It happens because that function (handler) is not rendered. Please give me solution to this problem. Here is the sample

(this is done on server side Page_Load event handler)

WebCombo1.ClientSideEvents.BeforeDropDown =

"WebCombo_BeforeDropDown" + ControlID;

(Now I have defined the handler on the client side as)

function WebCombo_BeforeDropDown<%=ControlID%>(webComboId)

{

.... my code here...

}

Thanks in Advance

Mudassar

The reason it does not work is because innerHTML, which UpdatePanel framework uses on the client side, does not work for embedded script tags in HTML.

If you can register the script blocks using ScriptManager.RegisterClientScriptBlock that will be the best. So instaed of putting them in script Tags generate them in a string and use ScriptManager.RegisterClientScriptBlock.