ラベル controls の投稿を表示しています。 すべての投稿を表示
ラベル controls の投稿を表示しています。 すべての投稿を表示

2012年3月28日水曜日

Reset (buttom) Functionality

Can somebody tell me of a robust way to reset controls (server side) on a form using ajax? Not sure if this is clear or not but the issue that I'm having is that I have an update panel that contains about 6-8 controls (drop down lists and text boxes). The text boxes contain ajax watermark extenders. I tried using the standard html reset button however, my watermarks are not coming back as the defautl text for each text box. Instead, the text boxes are just blank.

In addition, when just resetting a text box control in an update panel, if there is a dropdownlist (postback set to no) the drop down list flickers everytime and it is somewhat annoying.

Any advice and information on these two issues would be greatly appreciated.

Thanks

Hasn't anybody solved this?!

I've got a Reset link that calls a client-side javascript function, but I can't reset a watermarked textbox. (I've tried resetting its class attribute and its value, but it then loses its watermark behaviour.)

Any help would be greatSmile


I also am having this problem. It is amazing that nobody has replied!??Smile

Cheers

Reset Controls inside an UpdatePanel

Is there an easy way to reset all controls within an updatepanel without having to reload the page? Or can I reload the page without using Response.Redirect or Server.Transfer? My page has 3 updatepanels.

Pls Define "Reset".


Remove all data in the controls.


Hi,

Thank you for your post.

I think it is easy! Do you remeber the reset HTML contorl?

The contorl reset the whole form Elements to original value.

Just add this:

<input id="Reset1" type="reset" value="reset" />

If you don't want display it,just hidden it and fire the click event of it in javascript.

If you have further question, let me know.

Best Regards,


Thanks

Reset controls in update panel when error is thrown

Hello fellow developers,

A user enters a value in a textbox and i click a button to get some data, but a server error is thrown.

Is there a way to clear/reset the textbox in an UpdatePanel when there is a server error?

If there is a way, can someone assist in providing me that trick?

Thanks in Advance.

Protected Sub myButton_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles myButton.Click
Try
' Whatever code that I'm trying to run goes here.
' This is the code that my produce the error.
Catch
myTextbox.Text =""
End Try
End Sub


Can't you simply use a try/catch block, and catch the exception? If an exception is thrown reset it to the old value. You can use a hidden label or textbox to store the previous value.


Use this

protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
{
if (condition)
{
ScriptManager1.AsyncPostBackErrorMessage =
e.Exception.Message;

}
else
{
ScriptManager1.AsyncPostBackErrorMessage =
"An unspecified error occurred.";
}
}


I apologize. My example scenario was not explained the way I originally thought.

The example should be that when using AJAX you want to show an error message AND reset the controls.

If you write code to 'Throw' a custom error message to an alert window, nothing after the 'Throw' gets executed (clearing my textbox).

So my question really should be:

Is there a way, using AJAX, to 'Throw' a custom error message to an alert window and still reset controls? Either on the server or client side.

Thanks.


Protected Sub myButton_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles myButton.Click
Try
' Whatever code that I'm trying to run goes here.
' This is the code that my produce the error.
Catch exAs Exception
ScriptManager.RegisterStartupScript(Page, Page.GetType,"ErrorMsg", "alert('" & ex.Message & "');",True)
myTextbox.Text =""
End Try
End Sub


Thanks Buddha, that's just what I needed.

ResizableControlExtender in CollapsiblePanelExtender

Hi,

I have a series of dynamically created controls, each with a ResizableControlExtender within a CollapsiblePanelExtender...and all is good until the time you come to collapse the panel.

At this point, the resize image of the ResizableControlExtender stays exactly where it was on the page and is visible above all other controls on the page. I have tried setting the z-index property on all affected controls to sort this out, but this has had no effect.

Can anyone suggest anything else I need to do to sort out this issue?

Has anybody seen this before?

If it helps, I am adding the ResizableControlExtender to a Panel which contains a TextBox in order to resize the TextBox.


Hi,

Can you show me a simple repro?

Resize both panels at the same time with ResizableControlExtender

Hi;

Is it possible to resize two or more controls with the sameResizableControlExtender?

I mean just like in hotmail; when you enlarge left panel, right panel becomes automatically narrow

Thanks...

?


Hi,

You are actually referring to Splitter control, but as far as I know, this isn't available in AjaxControlToolkit yet( Please correct me if I'm wrong. ).

You may have to implement your own one or may try finding if there is any existing component.

Sorry for not being able to provide more help on this.


Thanks for your reply; u r right it's ain't there in AJAX v1;

I'll give a search for Splitter control cause theres no way to me to write mine own :D

Regards...


Actually I've found good examples here:

www.codeproject.com/useritems/VwdCmsSplitterBar.asp

Thanks...

Resizing Tab Control to fit contained controls

Hi all,

I must be missing something, but I am having a problem with getting my tab control to fit around all the contained controls. What I am doing is adding some controls during runtime and trying to get them to fit within the tab contained area. So for example:


I have a tab control that contains functionality to search by attribute from a data table. So there are 2 combo boxes, a text box, and a button. When the user selects a value from the combo boxes and enters a value in the text box, then they can press find. When they press find, I set the datasource on a grid to reflect this query and display the grid. The problem is that my grid is being displayed outside of the colored area of my tab control. I am having this same difficulty when I add an accordion of grids to another tab.

I would appreciate any help someone can give me on this subject. I have tried changing my style sheet to include padding settings, but that didn't seem to work (though I may have not set something correctly there).

Thanks in advance.

Hello all,

I recently made a post, but I can't seem to find it now. So sorry for the redundancy of this question.

I have a tab control that I am dynamically adding an accordion to with grids inside each level of the accordion. My problem is that my tab control does not visiby resize to contain the controls that I am dynamically adding to it. Can someone give me an idea on what I might can do to force the tab to redraw to visibly contain these controls? Please tell me if this doesn't describe the problem well enough and I will try to do a better job.

Thanks,
Lee

Resolving <%=MyControl.ClientID%> in a clientside Script which is loaded via ScriptM

Hi experts and developers!

I have a problem using the <%=MyControl.ClientID%> syntax to resolve controls when using clientside script. I really need this functionality though because the control of which i need the clientside id is generated (and dynamically named) by a third party control (DataGrid) I use.

How is it possible to find out the ClientID of a control when the clientside script is loaded via ScriptManager.RegisterClientScriptInclude()?

Thanks for your help in advance!

Greetings,
Wolfgang

hello.

i think i'm not understanding your question very well. MyControl.ClientID gives you the ID of the client...maybe you just need to concatenate it to the rest of the string that is being register as script so that it works...can you show us the code where you're having the problem?


Hi Luis!

Your solution sound absolutely reasonable, but as i use a separate JavaScript File, the <%= %> syntax won't work. And also it does not sound to practicable to change the JavaScript file at runtime (all the time, because the ClientID of the controls changes).

I found a solution already though: I'm just using ClientScript.RegisterArrayDeclaration(MyClientID, myControl.ClientID) on Page_PreRender()... After that I can access the ClientID in my JavaScritp File just via MyClientID[0] as it is a normal js array.

Thanks for the reply!
Wolfgang


hi.

i'd do something like that too if i had the script in a separate file (which is really the recommended approach for script files:))

2012年3月26日月曜日

Response.Redirect and regular postbacks

I have an updatepanel that includes several controls, and I need to be able to do things such as export to outlook, export to excel and use fileupload controls.

To move those links outside of updatepanels would compromise my layout.

Is there anyway I can force a button to perform a classic postback if it's inside an update panel?

Thanks!Hmmm, interesting. Here's an idea. Could you have a button outside the UpdatePanel with the "visibility:hidden" style set (NOT Visible=False, btw), and then have a button inside the UpdatePanel who's onclick script is "onclick='realPostBackButton.click()". So basically when the user clicks the button inside the UpdatePanel it just triggers a trick outside of it.
thanks for the tip. i could do that. if that's the only workaround possible, then i suppose it isn't too painful.

I can't think of another way to do it, so we'll keep it our little secret. :)


My button is outside of the update pannel and I get errors trying to export to excel. It gives me the following error:

Control 'ctl00_contentPlaceHolder_GridView1' of type 'GridView' must be placed inside a form tag with runat=server.

I think this is because I am using a Master Page with the Ultrapanel. My source for exporting to excel is:

protected

void btnExportToExcel_Click(object sender,ImageClickEventArgs e)

{

Response.Clear();

Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");

Response.Charset = "";

Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

GridView1.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

}

It fails on the RenderControl method. Any ideas?

Thanks,

Duncan


Just what the code says - the Gridview must be within a <form runat="server"> element, either in the MasterPage or in the ContentPanel.

So there is no way to export a gridview that is in an Atlas:UpdatePannel, because my understanding if exists there is will not be in a <form runat="server"> element. If you try to put the <form> element in the ContentPannel of the UpdatePannel then it will conflict with the one in the master page.


The one at the master page should be fine. Something else must be causing the problem - is the ContentPlaceHolder in the Master Page not within the form tag?

Note the SampleWebsite that's included wiht the Toolkit (DefaultMaster.master) has a form tag and the GridView's in the sample pages work correctly.


I ended up using the Interop.Excel dll to export to excel and it worked.

I couldn't get my old method to work but it doesn't appear that it was an ATLAS issue. To get rid of that particular error I had add the following override.

public override void VerifyRenderingInServerForm(Control control)
{
// Confirms that an HtmlForm control is rendered for the

}


I am getting 'Unknown Error' and no export. What is the deal?. Is it possible to use Atlas and export to Excel?
Because AJAX is not doing a full post I found that you cannot do an export to excel with Response.Write. What I had to do was save the file to the server, and then do a windows.open in my javascript OnClientClick funtion.

Response.Redirect cannot be called in a page callback error message.

Hi. I'm using the Dundas Chart Controls in VS 2005. These controls are built utilizing AJAX. I have a basic page with a dundas chart control containing a funnel chart. The funnel contains Quotes, Sales Orders and Invoices. When the user clicks on the control, I want to determine whether they clicked on Quotes, Sales Orders or Invoices and transfer to the appropriate Details Page. I've got the code working to determine which transaction type they clicked on; but, I get the "Response.Redirect cannot be called in a page callback." error when the page tries to redirect. Note: I get a similar issue if I try server.transfer.

Suggestions?

Here's my code:

Dim hitTestResultAs Dundas.Charting.WebControl.HitTestResult = Chart1.HitTest(e.X, e.Y)If Not (hitTestResultIs Nothing)Then Dim clickedAs Dundas.Charting.WebControl.DataPoint = hitTestResult.Series.Points(hitTestResult.PointIndex)Select Case hitTestResult.PointIndexCase 0 Response.Redirect("COQuotes.aspx")Case 1 Response.Redirect("COOrders.aspx")Case 2 Response.Redirect("COOrders.aspx")End Select End If

Since it's a partial postback that is occuring, you can't use Response.Redirect. You need to do a full postback in order to redirect or use a different method. See the last message in this post:http://forums.asp.net/t/1165851.aspx

-Damien


I have no control over the callback. It is being executed by the Dundas Control. I tried implementing the code with the RegisterClientScript, as below. But, nothing happens...

Dim hitTestResultAs Dundas.Charting.WebControl.HitTestResult = Chart1.HitTest(e.X, e.Y)If Not (hitTestResultIs Nothing)Then Dim clickedAs Dundas.Charting.WebControl.DataPoint = hitTestResult.Series.Points(hitTestResult.PointIndex)Select Case hitTestResult.PointIndexCase 0 clientRedirect("COQuotes.aspx")Case 1 clientRedirect("COOrders.aspx")Case 2 clientRedirect("COOrders.aspx")End SelectSub clientRedirect(ByVal URL)Dim jScriptAs String jScript =String.Format("document.location.href ='{0}');", URL) ClientScript.RegisterClientScriptBlock(Page.GetType(), "redirect", jScript,True)End Sub


GiveRegisterStartupScript a try. Seehttp://blogs.ittoolbox.com/c/coding/archives/registerclientscriptblock-and-registerstartupscript-17321 for some more info.

-Damien


Tried RegisterStartupScript, still nothing happens.

Jennifer


Hi,

I'm not familiar with dundas chart but is there no way to setup a href on a chart element during rendering? I would have thought this would be a standard feature.

Back to your Response.Redirect problem. When you get a response from the callback can you control the client-side callback function? If so you could use the cookie method as in the last post. If you have no control over the client-side callback function I very much doubt your going to be able to add the functionality you require.

One minor point, if your re-directing anyway whay do you need to use ajax, you could do a page post back when clicking the chart, do your logic and then redirect. To the user the behavior would seem exactly the same as your moving to a different page anyway.

Cheers Si


You won't be able to use Response.Redirect() or Server.Transfer() in a callback, check if the control has a client event you can use instead, if that event exists you could use window.location.replace("OtherPage.aspx"); using JavaScript from the client to move to another page.

Retrieve value from a dynamically created control inside an UpadetPanel

I would like to dynamically create some controls - tablecells, textboxes, and dropdownlists inside an AJAX UpdatePanel.
How would I retrieve the values that user enters into these controls in my vb.net code behind?
Can you please provide vb.net sample code ??

Here is my code:

'creates the textboxes - works fine

For i = 1 To intUnseatedGuestCount
Dim txtFirstName As New TextBox
txtFirstName.ID = "txtFirstName" + i.ToString
Me.tdNewSeatingCards.Controls.Add(txtFirstName)
Next

'code to retreive the values - produces an error message

Object reference not set to an instance of an object

For i = 1 To Me.hidNewSeatingCardCount.value
strTXTName = "txtFirstName" + i.ToString
Dim myTXT As TextBox = CType(Me.tdNewSeatingCards.FindControl("txtFirstName" + i.ToString), TextBox)
strTest += myTXT.Text + "<br>"
Next

Thank you for your help

You are creating controls dynamically, So on every postback (even in asynchronous postbacks ) you have to create it


OK Here is my code to recreate the controls:

For i = 1 To Me.hidNewSeatingCardCount.Value
Dim txtFirstName As TextBox = CType(Me.tdNewSeatingCards.FindControl("txtFirstName" + i.ToString), TextBox)
txtFirstName.ID = "txtFirstName" + i.ToString
Me.tdNewSeatingCards.Controls.Add(txtFirstName)
strTest += CType(Me.tdNewSeatingCards.FindControl("txtFirstName" + i.ToString), TextBox).Text
Next

There are no error messages, but I am not getting the values that the user enters into the textbox.

Thank you


Hi,

Thank you for your post!

You should place your recreate code in the init event.

The cause of the issue is viewstate process is finished before you recreate your controls!

If you have further questions,let me know!

Best Regards,

retrieve value from a dynamically created control

I would like dynamically create some controls - tablecells, textboxes, and dropdownlists inside an AJAX UpdatePanel.

How would I retrieve the values that user enters into these controls in my vb.net code behind?

Can you please provide vb.net sample code ??

Thank you for your help

http://forums.devx.com/showthread.php?t=16770

http://mail.123aspx.com/ArticleFrame.aspx?res=31558


here is a nice tutorial with example / code on how to create Dynamic controls and how to retrieve values from these dynamic controls.. [Page_Init() event is used here...]

SingingEels : Dynamically Created Controls in ASP.NET

hope it helps./.

Retrieve viewstate during a GET request

I have a page with controls that specify a filter on a set ofresults. I have used ajax and the update panel to show updated resultsthrough asynchronous request when the filter gets updated. When theuser selects an item in the set they navigate to a different page...when they then hit the back button they return to the filter page butall the controls are all re-initialized.

What I've been trying isgenerating an id for the page on the initial request (as is done andnormally placed in a hidden field for my custom PageStatePersister thatkeeps the viewstate in a database) but then redirecting the user to aurl with the id appended. So when you later hit the back button youhave the id in the URL.


Next LoadViewState is NOT calledunless the request is the result of a postback. Well I've been tryingto initialize the ViewState in the Page_Load by callingLoadPageStateFromPersistenceMedium() and that does result in callingthrough my custom PageStatePersister... But the ViewState dictionary ofthe page does not get updated... what am I missing?

Or is there another way to accomplish not losing the filter values?

Ok...this is going to be hard for me to explain..but I shall try. And i will suggest two solutions. First of all remember client side styles are not persisted unless asked, and viewstate track changes to state only when tracking is enabled. So all your controls are reinitialised because tracking gets enabled after oninit() and then viewstate just deserializes the stored data.

So unless you set trackviewState(), viewstate is not tracking anything. (Once on, cannot be turned off) Once tracking is on..viewstates items can be marked dirty(IsItemdirty()). You can also set an item to be dirty. Basically tracking allows viewstate to monitor which of its elements have changed since TrackViewState() has been called. Statebag ignores the items that are not marked dirty when it comes to saving view state SaveViewState() and hence items not marked dirty are not serialized.

So one of the solution is to markitems dirty which you want to be persisted before that postback. The other is dont do it by ajax but by actual user controls.

Just a question for you to ponder, if you have two identical pages with a textbox and a button with on onclicking code.

as <as:textbox runat="server" text="abc"><asp:button runat="server" text="submit">

with other pages only having change in its text property as text="the quick brown fox jumps over the little lazy dog" Do the two pages have same viewstate?

Read this article if you want to understand viewstate.

http://msdn2.microsoft.com/en-us/library/ms972976.aspx


I appreciate your feedback but I'm not sure how it applies... I'm not having problems writing viewstate... I'm having problems loading the viewstate during a GET request. I'll try articulating my problem differently:

1) I've persisted the viewstate on the server side.
2) The viewstate is identified by a hidden field and so is in the form data during a postback (this already works)
3) On the first GET of a page I generate the identifier and redirect the request to a page with the viewstate identifier appended to the URL
4) By default Viewstate is NOT loaded during a GET request only POSTBACK
5) On the first GET of the URL+ViewstateID, the viewstate does not exist and the page runs through normal initialization
6) On subsequent requests to URL+ViewstateID does exist and I want to load this Viewstate from storage (see 4)
7) I've tried Page.LoadPageStateFromPersistenceMedium() which does call my pagestatepersister and retrieves the viewstate... now how do I apply this to the page instance...? can I ...?


before you move on to the next page, you can either save your viewstate as I said in my previous post and write it to a session and later on retreive the session, and put it back in viewstate.

Although this can be accomplished by plain sessions.

2012年3月21日水曜日

Rounded Corners Fetaure Suggestion

Hey guys/girls/people,

The controls are great - I have a feature suggestion for the Rounded corners...

TopVisible - Boolean - show/hide the top div

BottomVisible - Boolean - show/hide the bottom div

TopText - String - Text to be shown in the top rounded div

TopCssClass - String - cssclass to be used to style the top text

This would allow you to create sidebar panels like they use in the community server...

http://communityserver.org/Default.aspx

Cheers!!

Andrew

Hey!,

This is a great idea, i have the same feature, specially the TopText String Property...

Bye!, Moisés.

rouf:

Hey!,

This is a great idea, i have the same feature, specially the TopText String Property...

Bye!, Moisés.

Have another question... Why when I use a Atlas Update Panel near a Rounder Corners Extender the corners split in various lines?, something like this :
______
__________
_______________

Sorry for my eng...

This is a good idea. Could you please file a feature request at

http://www.codeplex.com/WorkItem/List.aspx?ProjectName=AtlasControlToolkit

Thanks!


This bug is already fixedBig Smile

rounded corners with firefox and opera

I am using some rounded corner controls on an app im testing. In IE they work perfectly but in firefox and opera the borders are broken. The rounded part shows but it detached from the vertical borders. Has anyone else had this happen? HOw do you fix it?I wrote some testing codes to check Ajax:RoundedCornersExtenderand found it worked fine in IE7,FireFox and Opera.I installed Visual Studio 2005 with Ajax Beta 2 and Futures November CTP in my PC.Here are my testing?codes?for?your?
reference.
<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<div>
<asp:Panel ID="pnlRoundedCorner" runat="server" BackColor="LimeGreen">
<table>
<tr><td id="RoundedCorner">Rounded Corner Rectangle:<asp:TextBox ID="TBRoundedCorner" runat="server"></asp:TextBox></td></tr>
</table>
</asp:Panel>
<Ajax:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="pnlRoundedCorner" Radius="60"></Ajax:RoundedCornersExtender>
</div>
AjaxEnabled website web.config:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="Microsoft.Web.Configuration.ScriptingSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="webServices" type="Microsoft.Web.Configuration.ScriptingWebServicesSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="Microsoft.Web.Configuration.ScriptingJsonSerializationSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
<section name="profileService" type="Microsoft.Web.Configuration.ScriptingProfileServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
<section name="authenticationService" type="Microsoft.Web.Configuration.ScriptingAuthenticationServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<connectionStrings>
<add name="AspForumsConnection" connectionString="Data Source=.;Initial Catalog=Performancing;UID=sa;PWD=Infy_1001"
providerName="System.Data.SqlClient" />
<add name="ProductConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Product.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagPrefix="asp" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CompareValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CustomValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RangeValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RegularExpressionValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RequiredFieldValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Microsoft.Web.UI.Compatibility.ValidationSummary, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</tagMapping>
</pages>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
</httpHandlers>
<httpModules>
<add name="WebResourceCompression" type="Microsoft.Web.Handlers.WebResourceCompressionModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptModule" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" />
</httpModules>
<!--<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" timeout="1" cookieName="PHPSESS_ID@.PLANETRE" cookieless="UseCookies"/>-->
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler"/>
</handlers>
</system.webServer>
</configuration>
Besides,try to set "Fit to Width" in Opera,otherwise maybe you will get the inorder web controls in a web page.
Can you post some codes here?Let me try to test it and check what's the result.
Wish the above can help you.

RoundedCorners used with other controls

Has anyone had any luck in using the RoundedCorners control with any other controls, such as HoverMenu, Popup, etc?

PopupControl calendar in ajax beta 2 toolkit:

<asp:Panel ID="Panel1" runat="server" CssClass="popupControl"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <center> <asp:Panel ID="Panelx" runat="server" Width="160px" CssClass="xroundedPanel"> <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999" CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Width="160px" OnSelectionChanged="Calendar1_SelectionChanged"> <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" /> <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" /> <SelectorStyle BackColor="#CCCCCC" /> <WeekendDayStyle BackColor="#FFFFCC" /> <OtherMonthDayStyle ForeColor="#808080" /> <NextPrevStyle VerticalAlign="Bottom" /> <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" /> <TitleStyle BackColor="#999999" Font-Size="7pt" BorderColor="Black" Font-Bold="True" /> </asp:Calendar> </asp:Panel> </center> <ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" BehaviorID="RoundedCornersBehavior1" runat="server" TargetControlID="Panelx" Radius="4" /> </ContentTemplate> </asp:UpdatePanel> </asp:Panel>

StyleSheetcss:

/* Rounded Corners*/.xroundedPanel{width:160px;background-color:#999999;}.roundedPanel{width:300px;background-color:#5377A9;color:white;font-weight:bold;}


PopupControl reminder message in ajax beta 2 toolkit:

StyleSheet.css:

/*Popup Control*/.ypopupControl{background:transparent;position:absolute;visibility:hidden;}.popupControl{background-color:White;position:absolute;visibility:hidden;}/* Rounded Corners*/.yroundedPanel{width:200px;background-color:#849EC0;}.xroundedPanel{width:160px;background-color:#999999;}.roundedPanel{width:300px;background-color:#5377A9;color:white;font-weight:bold;}

PopupControl.aspx:

<asp:Panel ID="Panel2" runat="server" CssClass="ypopupControl"> <div style="border:0px outset white; width:200px; font-weight: bold;"> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:Panel ID="Panely" runat="server" Width="200px" CssClass="yroundedPanel"> <asp:RadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem Text=" Walk dog"></asp:ListItem> <asp:ListItem Text=" Feed dog"></asp:ListItem> <asp:ListItem Text=" Feed cat"></asp:ListItem> <asp:ListItem Text=" Feed fish"></asp:ListItem> <asp:ListItem Text=" Cancel" Value=""></asp:ListItem> </asp:RadioButtonList> </asp:Panel> <ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender2" BehaviorID="RoundedCornersBehavior1" runat="server" TargetControlID="Panely" Radius="8" /> </ContentTemplate> </asp:UpdatePanel> </div> </asp:Panel>

Rounded Corners applied to Hovermenu Demonstration in ajax beta 2 toolkit.

In this example, the rightmost Update/Cancel hover has rounded corners.

So far, a design/coding issue results in an unsatisfactory solution for the leftmost Edit/Delete hover. To be taken-up in a different thread.

StyleSheet.css:

 
/*Hover Menu*/.popupMenua {/*for roundedcorners-hovermenu demo*/position:absolute;visibility:hidden;background-color:red;background:transparent;/*hide corners*/opacity:.9;filter: alpha(opacity=90);}.popupMenu {position:absolute;visibility:hidden;background-color:#F5F7F8;opacity:.9;filter: alpha(opacity=90);}.popupHover { position:relative;/*fix IE cold-spot between hover & grid*/background-image:url(images/header-opened.png);background-repeat:repeat-x;background-position:left top;background-color:#F5F7F8;}/* Rounded Corners*/.ahovermenuroundedPanel/*for roundedcorners-hovermenu demo*/{width:80px;background-color:orange;/*for demo clarity*/}

HoverMenu.aspx:

<asp:UpdatePanel ID="up1" runat="server"> <ContentTemplate> <asp:GridView BackColor="Azure" GridLines="None" ShowHeader="False" Width="100%" ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ItemID" DataSourceID="ObjectDataSource1"> <Columns> <asp:TemplateField> <EditItemTemplate> <asp:Panel ID="Panel9a" runat="server" Width="80%"> <table width="100%"> <tr> <td width="30%">Title:<br /><asp:TextBox Font-Bold="true" ID="TextBox1" runat="server" Text='<%# Bind("Title")%>' Width="100"></asp:TextBox></td> <td width="55%">Desc:<br /><asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Description")%>' Width="150"></asp:TextBox></td> <td width="15%">Pri:<br /><asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Priority")%>' Width="40"></asp:TextBox></td> </tr> </table> </asp:Panel> <ajaxToolkit:HoverMenuExtender ID="hme1" runat="Server" TargetControlID="Panel9a" PopupControlID="PopupMenu" HoverCssClass="popupHover" PopupPosition="Right"> </ajaxToolkit:HoverMenuExtender><!--added closing tag to be consistent with hme2 below--> <asp:Panel ID="PopupMenu" runat="server" Width="80" CssClass="popupMenua"><!--modified styling--> <asp:Panel ID="RoundedCornersPanela" runat="server" Width="80px" CssClass="ahovermenuroundedPanel"><!--added panel--> <div style="text-align: center;"> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update"> </asp:LinkButton> <br /> <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"> </asp:LinkButton> </div> </asp:Panel><!--RoundedCornersPanela--> </asp:Panel><!--PopupMenu--> <ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1a" BehaviorID="RoundedCornersBehavior1" runat="server" TargetControlID="RoundedCornersPanela" Radius="6" /><!--added extender--> </EditItemTemplate> <ItemTemplate> <asp:Panel ID="PopupMenuED" runat="server" Width="80" CssClass="popupMenua"><!--modified styling--> <div> <asp:Panel ID="RoundedCornersEDPanel" runat="server" Width="80px" CssClass="ahovermenuroundedPanel"><!--added panel--> <div style="text-align: center;"> <div> <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Edit" Text="Edit"> </asp:LinkButton> </div> <div> <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" Text="Delete"> </asp:LinkButton> </div> </div> </asp:Panel><!--ID="RoundedCornersEDPanel"--> </div> </asp:Panel><!--ID="PopupMenuED"--> <!--RoundedCornersExtender1b placeholder--> <asp:Panel ID="Panel9b" runat="server"> <table width="100%"> <tr> <td width="25%"><asp:Label Font-Bold="true" ID="Label1" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("Title")))%>'></asp:Label></td> <td width="50%"><asp:Label ID="Label2" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("Description")))%>'></asp:Label></td> <td width="25%"><asp:Label ID="Label3" runat="server" Text='<%# Eval("Priority")%>'></asp:Label></td> </tr> </table> </asp:Panel> <ajaxToolkit:HoverMenuExtender ID="hme2" runat="Server" HoverCssClass="popupHover" PopupControlID="PopupMenuED" PopupPosition="Left" TargetControlID="Panel9b" PopDelay="25"> </ajaxToolkit:HoverMenuExtender> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="Select" TypeName="SessionTodoXmlDataObject" UpdateMethod="Update"> <DeleteParameters> <asp:Parameter Name="Original_ItemID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="Description" Type="String" /> <asp:Parameter Name="Priority" Type="Int32" /> <asp:Parameter Name="Original_ItemID" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="Description" Type="String" /> <asp:Parameter Name="Priority" Type="Int32" /> </InsertParameters> </asp:ObjectDataSource></ContentTemplate></asp:UpdatePanel>

AlwaysVisibleControl ajax beta 2 toolkit:

<asp:UpdatePanel ID="update" runat="server"> <ContentTemplate> <div style="width:230px;height:100px;"> <asp:Panel ID="timer" runat="server" Width="220px" BackColor="White" ForeColor="DarkBlue" BorderWidth="0" BorderStyle="solid" BorderColor="DarkBlue" style="z-index: 1;"> <div style="width: 100%; height: 100%; vertical-align: middle; text-align: center;"><p>Current Time:</p><span id="currentTime" runat="server" style="font-size:xx-large;font-weight:bold;line-height:40px;"/></div> </asp:Panel> <ajaxToolkit:AlwaysVisibleControlExtender ID="avce" runat="server" TargetControlID="timer" VerticalSide="Top" VerticalOffset="10" HorizontalSide="Right" HorizontalOffset="10" ScrollEffectDuration=".1" /> <ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" BehaviorID="RoundedCornersBehavior1" runat="server" TargetControlID="timer" Radius="14" /> </div>

Quick question for you - your posting example code - but are you getting errors? Fiddler would be able to provide some additional input - so can you provide some additional info. I tried rounded corners with some other controls myself and all I got some explicit errors that I annotated...http://forums.asp.net/thread/1440377.aspx(I never bothered to bug report it as I simply got tired of posting in so many places and never seem to get the issues addressed or they dissapear ...)

What exactly is the description of the problems in the examples...


Thanks - the description of the problem is: Has anyone had any luck in using the RoundedCorners control with any other controls, such as HoverMenu, Popup, etc?

Answer - yes, if you tinker with various toolkit samples, applying the RoundedCorners extender works just fine.


Datagrid in ajax toolkit beta 2 HoverMenu sample

<asp:UpdatePanel ID="up1" runat="server"> <ContentTemplate> <asp:Panel ID="RoundedGrid" runat="server" Width="100%" CssClass="ahovermenuroundedPanel"><!--added panel--> <ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" BehaviorID="RoundedCornersBehavior1" runat="server" TargetControlID="RoundedGrid" Radius="13"/><!--added extender--> <asp:GridView BackColor="orange" GridLines="None" ShowHeader="False" Width="100%" ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ItemID" DataSourceID="ObjectDataSource1">

StyleSheet.css

/* Rounded Corners*/.ahovermenuroundedPanel/*for roundedcorners-hovermenu demo*/{width:80px;background-color:orange;/*for demo clarity*/}


Here's what I tried. And got a quirky behavior. I tried to use RoundedCorners with a TextBox control. Since there is no restriction on what type of control it can extend I thought it would be interesting to see how it behaved if used with a text box.

Well it did not round the corners of the text box but somehow when I put my mouse over the text box I got a crosshair cursor the one you get when you are over a draggable item. If i clicked the textbox it selected the textbox like in the design view in VS. With extension points at the corners and the middle of the sides. I could then put the mouse on one of those points and the cursor would change to a "resize" cursor and I could actually drag the mouse and see an outlined shape being resized though the text box was not being resized. Very peculiar indeed. I wasn't using a Master Page but I had two RoundedCornerExtenders on the page one for a normal Panel control and the other for the TextBox.

The question is can anyone else reproduce the behavior and if they can then I suppose its a bug. Maybe there should be a way to specify in an extender what type of controls it DOESN'T support, so that when you try to assign the TargetControlID to a control that is not supported then a validation message can appear at design time warning the user that the type is not supported. I will work on changing the RoundedCornersExtender control to add that functionality for the types of controls that I know it doesn't work with.

If you have any other .NET server controls you found that it does not work with then let me know.

Thanks


I intepreted the question like Silver did. Which is can you use the RoundedControlExtender with other controls like GridView, Textbox, checkbox. What I mean by that is can you set the TargetControlID of the RoundedCornersExtender to an ID of a control of type Textbox or GridView or Checkbox? The thing is in ALL the examples shown above in this chain the extender is used to extend the Panel. If a Panel is the only thing that can be extended with this extender then why not restrict it to a panel like the Textboxwatermark extender is restricted to controls of type TextBox only or ConfirmButton Extender is restricted to controls of type Button only??

Thanks


I too would very much like the roundercorners to works with the gridview control. Right now I'm trying to put my gridview in a panel with rounded corners but the panel doesn't seem to want to auto-resize with the gridview, so i'm having some issues there.

RoundedCorners Help

Great set of controls.. I refuse to develop AJAX in any other language!!..

Just one small problem, i have a panel that i want to use for messages, error or success, it will have diferent colours for each, red and orange i'm trying to implement it so that i only need to change the CSSClass of the panel, without touching the extender, i like to separate styling from code, but the corners are not picking up the colour of the panel! This is what i've got

 <asp:Panel ID="InfoPanel" runat="server" CssClass="info-panel-default" Visible="False"> <div> Success: Information submitted successfully. </div> </asp:Panel> <ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" Radius="3" TargetControlID="InfoPanel"> </ajaxToolkit:RoundedCornersExtender>

the CSS:

.info-panel-default {background-color:#fad163;width:300px; margin:0 auto; font-size:12px;text-align:center;font-weight:bold;padding:3px;}.info-panel-default div{background-color:#fad163;}

Any help much appreciated...

RoundedCorners looks at the color of the TargetControlID when it initializes and then uses that color to create the rounded elements. Have a look at its set_Color function for a way to change the color via script at a later time.

RoundedCornersExtender & Panel control

How do I assing a controlID to more then one panel control.

I would like to use one RoundedCornersExtender with about 3 panel controls.

Is this possible?

You should create 3 instanes of RoundedCornersExtender - one for each of the 3 panels.

This should be done in the code behind?

Im using C#. Could you just show me how to do one plz.

After I create an instance I should assing that panel as the target control of the roundedCornerControl ?


There's an example here:http://ajax.asp.net/ajaxtoolkit/RoundedCorners/RoundedCorners.aspx
This example demonstrates a problem I am having with rounded corners. When the corners are configured, the height of the panel changes dynamically. This is really annoying to see during page load in the browser, as the content of the page slides down right after the page is finished loading. How can I work around this? (i.e., I tried setting margin styles in the panel and this does not work).

This example show it using one panel & a RoundedCornersExtender.

I would like to use 5 panels & one RoundedCornersExtender. Any suggestions ?

RoundedCornersExtender bug

The target control's width does not change when the browser windows's size is changed.Try giving it a width=100%:
<%@. Page Language="C#" %><%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %><!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"> <div> <atlas:ScriptManager ID="ScriptManager1" runat="server" /> <asp:Panel ID="Panel1" runat="server" style="width:100%;background-color:Lime"> Text </asp:Panel> <atlasToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server"> <atlasToolkit:RoundedCornersProperties TargetControlID="Panel1" /> </atlasToolkit:RoundedCornersExtender> </div> </form></body></html>

That is exactly what I did.

If the orginal browser windows is not at maximum size. Click at the browser titlebar to maximum the browser windows' size, the panel's width would not change accordingly. If I remove the roundedcornersextender, everything works fine


I just verified that the code I gave above works in IE7 and Firefox. What browser are you using?

If you put the style in a css file,then the problem shows up.

<%@.PageLanguage="C#" %>

<%@.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="atlasToolkit" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headid="Head1"runat="server">

<title>Untitled Page</title>

<linkhref="StyleSheet.css"rel="stylesheet"type="text/css"/>

</head>

<body>

<formid="form1"runat="server">

<div>

<atlas:ScriptManagerID="ScriptManager1"runat="server"/>

<asp:PanelID="Panel1"runat="server"CssClass="pnl">

Text

</asp:Panel>

<atlasToolkit:RoundedCornersExtenderID="RoundedCornersExtender1"runat="server">

<atlasToolkit:RoundedCornersPropertiesTargetControlID="Panel1"/>

</atlasToolkit:RoundedCornersExtender>

</div>

</form>

</body>

</html>

In theStyleSheet.css

.pnl

{

background-color:#ccffff;

width:100%;

}

BTW,I am using IE6


Okay. Bad news, I think. Here's the relevant code from RoundedCornersBehavior.js:

} else {
// Note: Do NOT use CommonToolkitScripts.getCurrentStyle in the check below
// because that breaks the work-around
if (!e.style.width && (0 < originalWidth)) {
// The following line works around a problem where IE renders the first
// rounded DIV about 6 pixels too high if e doesn't have a width or height
e.style.width = originalWidth + "px";
}
}

It's the use of "e.style.width" that causes this to stop working if you move the style to a file (or even a <style> element). But the fix of using getCurrentStyle means that the workaround doesn't fire when it needs to and you hit the weird rendering problem in IE.

If it's possible to put the "width:100%" style on the element itself, I'd highly recommend doing so.

RoundedCornersExtender and ResizableControlExtender together in IE

Hey all,

I am using both controls together for one panel. works fine in Mozilla, but in IE the hole panel seems to be positioned 20px down
and becomes a strange line on top.

Has anyone an idea what I am doing wrong?

Thanks in advance,

Pascal

Hi Pascal,

Perhaps you can post a code sample demonstrating what's going wrong. You should be able to get this to work if you're careful about the order in which you apply the extenders.

Thanks,
Ted