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

2012年3月28日水曜日

requirePermission="false" in the web.config return warning.

I have unstalled AJAX rc 1 and I get the following warning(4 times), from my web project web.config, after compilation:

"The 'requirePermission' attribute is not declared"

How can I get rid of this warning ?

It comes from this section:

<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>

Hi leeorc

pleas review link below

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

hope it helps you


Ok I took the following advice:

You can workaround it by opening "c:\Program Files\Microsoft Visual Studio 8\XML\Schemas\dotnetconfig.xsd" and inserting the following at line 40:

"<xs:attribute name="requirePermission" type="boolean_type" use="optional" />"

-------------------------------

Despite the fact that one person didnt recommend it, the workaroundhelpedme with non harmful ireversable issues.

Thanks

Leeor


I found that in the string "<xs:attribute name="requirePermission" type="boolean_type" use="optional" />", the type should be Type, I mean the t should be upper cased.

Liang

Resizable Control bug?

The following code:

_lining.style.backgroundImage = 'url(invalid)'; // Keeps IE from ignoring the content-free element

in ResizableControlBehavior class is not working well with IE6. The image is being requested by browser every event the control fires (mousedown, mouseup, mousemove etc.). Check out your browser's status bar while resizing the control (watch it carefully as the text blinks very quickly) or use Nikhil's Web Development Helper with http logging on to see the requests.

There are many ways to fix this. I use solid black background with 20% opacity for additional effect.

Thanks for reporting this. Could you file an issue with this information atwww.codeplex.com?

Choose "Atlas Control Toolkit" then "Issues".

Thanks!

2012年3月26日月曜日

Response.Redirect doesnt work when the button is inside an ajax updatepanel

Hello,

I am getting the following error whenever I click a button inside an ajax updatepanel and it tries to Response.Redirect from the code behind.

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near'

<!DOCTYPE html P'

I wasn't sure if it was my page not being correct or if it was something else. So I created two basic test pages test.aspx and test2.aspx. I click a button on text.aspx and it is supose to redirect to test2.aspx. This is a basic example giving the exact same error. So hopefully if I can get a resolution to this I could fix my real asp.net page. Thanks, Risso

Here is the test.aspx code:

<%

@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="test.aspx.cs"Inherits="test" %>

<%

@dotnet.itags.org.RegisterAssembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"Namespace="System.Web.UI"TagPrefix="asp" %>

<!

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">

<

headrunat="server"><linkhref="css/modaldialog.css"rel="stylesheet"type="text/css"/><title>Untitled Page</title>

</

head>

<

body><formid="form1"runat="server"><div><asp:ScriptManagerID="ScriptManager1"runat="server" ></asp:ScriptManager><asp:UpdatePanelID="UpdatePanel1"runat="server"><ContentTemplate><asp:ButtonID="Button1"runat="server"OnClick="Button1_Click2"Text="Button"/></ContentTemplate></asp:UpdatePanel></div></form>

</

body>

</

html>

HERE IS the Code behind code:

using

System;

using

System.Data;

using

System.Configuration;

using

System.Collections;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Web.UI.HtmlControls;

public

partialclasstest : System.Web.UI.Page

{

protectedvoid Page_Load(object sender,EventArgs e)

{

}

protectedvoid Button1_Click2(object sender,EventArgs e)

{

Response.Redirect(

"~/test2.aspx");

}

}

HI.

Try to useServer.Transfer.


I did server.transfer shown below. It still gives the same error message. I put a breakpoint in the test2.aspx to see if it makes it to that pages_load event and it does, but the browser throws the exact same error message as listed in the first post. Any other ideas?

protectedvoid Button1_Click2(object sender,EventArgs e)

{

Server.Transfer("~/test2.aspx");

}


Hi, u must knwo that Response.Redirect and Server.Transfer work inside UpdatePanel.

can u share us the detail of the error that u have.


I tried your code and one of my own and it appears to be fine. Before you start beatin your head against the wall, try this...

This a must read from Eilon Lipton's Technical blog on Microsoft ASP.NET and ASP.NET AJAX when trying to solve PageRequestManagerParserErrorException errors!

http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx?CommentPosted=true#commentmessage A


Eilon Lipton's tips are great, I just add some more: Test "test2.aspx" for any invalid html markup, also test the response with fiddler.

Ok,

I found out were it is happening, but now I am not sure how to solve it since what I have to remove is also needed. I found that it was inside the web.config. I'm adding 2 httphandlers that were needed to fix other AJAX issues. I don't recall exactly what those issues were because this is a big application and it was a while back. I do remember these were needed to fix other ajax problems though. I do not want to remove these and have them break other ajax controls/tools. Anyone know a work around for this. I do know now that these httpHandlers are what is causing my Response.Redirect() issue in my updatepanel.

I removed the following lines from my web.config for it to work.

<

httpHandlers>

<

removeverb="*"path="*.asmx"/>

<

addverb="*"path="*.asmx"validate="false"type="Microsoft.Web.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<

addverb="GET,HEAD"path="ScriptResource.axd"type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"validate="false"/>

</

httpHandlers>

Risso


Shoot, I just realized those were needed for the Ajax to work in IE. And by me removing those lines from the web.config it just does a normal postback and not an asynchronous call. That is why it worked for me. So really nothing has changed. I am back to nothing on why the response.redirect() doesn't work. You guys mentioned that you took the code and were able to get the response.redirect() to work. I'm not sure what in my environment could be any different. I'm running this off of localhost and I do not have IIS running.

Yeah. Have you tried a new website as ajax supported web? I tried both an iis and casini version of the test. What version of vs are you running?


Aesop:

Yeah. Have you tried a new website as ajax supported web? I tried both an iis and casini version of the test. What version of vs are you running?

Agree, use vs to create a new "ASP.NET Ajax-Enabled Web Site" or "ASP.NET Ajax CTP-Enabled Web Site", and use the web.config of the new site as a template, so carefully migrateyourweb.config into the template.

You can get a template web.config also from a similar path:

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Futures January CTP\v1.0.61025


Yes, I got it to work!! Thank you for your persistent responses. I did what you both recommended and started a new Ajax Application and pulled its web.config to compare to mine and went line by line with testing each line and found what I was missing. My web.config didn't have

<

httpModules>

<

addname="ScriptModule"type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</

httpModules>

Risso


Hi Rissoman,

Thanks your post. I have the problem like you. I took 2 days to find why I always take the PageRequestManagerParserErrorException. Well, I am upgrading the website, and missing the <httpModules>

Thanks again,

HUH


Thanks to everyone who posted about this. You've just saved me a lot of time and effort! Thanks!


HI,

Thanks a ton .for that code..

regards

Delia Joe

Response.Redirect inside a Thread

I have the following problem. I have to execute a async procedure in a thread. The Problem is that when the thread is completed I need to show the results in a new form. The moment i execute the Response.Redirect the following error is thrown. : Response is not available in this context.

I have also tried server.Transfer but with no luck

hello.

have you thought about using async pages?


What do you meen with Async Pages ? I am relatively new to the whole asp.net thing.

hello again.

take a look here:

http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/Default.aspx


You canuse an iframe to execute remote code pretty easily, as well.


Maybe I can explain a bit what I am trying to do. I have a form that needs to check when a MSMQ message comes in to forward onto anothter page. The Problem is that if I have a Timer everything works but the timer cause a lot of traffic. So I moved fun getMessage function into a thread and all is well untill I want to show a new form then I get the error.


If you can check that message queue in a static method (should be able to), this might be exactly what you need:http://encosia.com/2007/07/25/display-data-updates-in-real-time-with-ajax/

Just do a "document.href = RedirectPage.aspx;" instead of the call to __doPostBack(), when the page method detects that the message has arrived.

2012年3月21日水曜日

RoundedCorners not displaying vertical border

I have the following code for RoundedCorners.
<asp:Panel ID="Panel1" runat="server" Height="50px" Width="500px" >
<div style="padding:10px;text-align:center">
<div style="padding:5px; border:solid black thin;background-color:#B4B4B4;">
ggggggggggggggggggggggggggggg
</div>
</div>
</asp:Panel>
<cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server">
<cc1:RoundedCornersProperties TargetControlID="Panel1" Radius=2 Color="red" />
</cc1:RoundedCornersExtender
This only shows me horizontal border but not the vertical border. It shows me top and bottom border in red. Not left and right. What am I doing wrong?I'm not exactly sure what you mean, but I think you get the borders by replacing the first div tag with:

<div style="padding:10px;text-align:center;border-left:solid 1px red;border-right:solid 1px red"
I did that. It works. Thx. However, there is a gap between bottom horizontal line and left and right vertical lines

RoundedCornersExtender confilicting with ModalPopupExtender in IE ?

hey every one i have the following code ... when you comment out RounedCornersExtender...the gridview dispears when the page loads

any idea why that is... only happnes in IE ..mozilla works fine :S

<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Admin_Default" Title="Campaigns" %><%@dotnet.itags.org. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlastoolkit" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <atlas:ScriptManager ID="sm1" runat="server" EnablePartialRendering="True"> </atlas:ScriptManager><%-- <atlastoolkit:RoundedCornersExtender ID="rce" runat="server"> <atlastoolkit:RoundedCornersProperties TargetControlID="GV_CampaignList" Radius="8" Color="#507CD1" /> </atlastoolkit:RoundedCornersExtender>--%> <atlastoolkit:ModalPopupExtender ID="MPE" runat="server"> <atlastoolkit:ModalPopupProperties TargetControlID="insertLnkBtn" PopupControlID="insertPnl" BackgroundCssClass="modalBackground" /> </atlastoolkit:ModalPopupExtender> <div class="MessageHeader"> Campagins </div> <br /> <hr /> <div id="MainContent"> <asp:GridView ID="GV_CampaignList" runat="server" Width="400px" HorizontalAlign="Center" AllowPaging="True" AllowSorting="True" DataSourceID="DS_GetAllCampagins" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnSelectedIndexChanging="GridView1_SelectedIndexChanging"> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="C_SiebelID" HeaderText="ID" /> <asp:BoundField DataField="C_Title" HeaderText="Name" SortExpression="C_Title" /> <asp:CommandField ShowEditButton="True" /> <asp:CheckBoxField DataField="C_isActive" HeaderText="Active" /> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <EditRowStyle BackColor="#2461BF" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" /> <AlternatingRowStyle BackColor="White" /> <PagerSettings Position="TopAndBottom" /> </asp:GridView> <br /> <asp:LinkButton ID="insertLnkBtn" runat="Server" OnClientClick="ShowPanel();">Create New Campaign</asp:LinkButton> <script language="javascript" type="text/javascript"> function ShowPanel(){ document.getElementById('ctl00_ContentPlaceHolder1_insertPnl').style.visibility = "visible"; } </script> </div> <br /> <asp:Panel ID="insertPnl" runat="server" CssClass="popupControl"> <asp:DetailsView ID="DetailsView1" runat="server" CssClass="DetailView" AlternatingRowStyle-CssClass="DetailViewEven" HorizontalAlign="Center" GridLines="None" DataSourceID="DS_GetAllCampagins" DefaultMode="Insert"> <Fields> <asp:CommandField ShowInsertButton="True" HeaderText="Create New Campaign" ShowHeader="True" /> </Fields> <AlternatingRowStyle CssClass="DetailViewEven" /> </asp:DetailsView> </asp:Panel> <atlas:UpdateProgress ID="updating" runat="server"> <ProgressTemplate> Updating DataBase<img src="../images/ball2.gif" height="40" width="40" /> </ProgressTemplate> </atlas:UpdateProgress> <asp:SqlDataSource ID="DS_GetAllCampagins" runat="server" CacheDuration="600" ConnectionString="<%$ ConnectionStrings:LocalSqlServer%>" SelectCommand="Campaigns_Admin_GetAll" SelectCommandType="StoredProcedure" SqlCacheDependency="Campaigns" InsertCommand="Campaigns_Admin_Insert" InsertCommandType="StoredProcedure" UpdateCommandType="StoredProcedure"> </asp:SqlDataSource></asp:Content>
The GridView disappeared because the RoundedCorners was pointing at it, a TABLE, and the way RoundedCorners works is such that pointing it at a TABLE isn't great. So I added a wrapper Panel and tweaked the settings to get things centered again. The below page works for me in IE7 and FF:
<%@. 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"><script runat="server"></script><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="sm1" runat="server" EnablePartialRendering="True"> </atlas:ScriptManager> <atlastoolkit:RoundedCornersExtender ID="rce" runat="server"> <atlastoolkit:RoundedCornersProperties TargetControlID="Panel1" Radius="8" Color="#507CD1" /> </atlastoolkit:RoundedCornersExtender> <atlastoolkit:ModalPopupExtender ID="MPE" runat="server"> <atlastoolkit:ModalPopupProperties TargetControlID="insertLnkBtn" PopupControlID="insertPnl" BackgroundCssClass="modalBackground" /> </atlastoolkit:ModalPopupExtender> <div class="MessageHeader"> Campagins </div> <br /> <hr /> <div id="MainContent"> <asp:Panel ID="Panel1" runat="server" Width="400px" HorizontalAlign="Center" BackColor="lightblue" style="margin-left:auto;margin-right:auto;"> <asp:GridView ID="GV_CampaignList" runat="server" Width="400px" HorizontalAlign="Center" AllowPaging="True" AllowSorting="True" DataSourceID="DS_GetAllCampagins" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" > <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="C_SiebelID" HeaderText="ID" /> <asp:BoundField DataField="C_Title" HeaderText="Name" SortExpression="C_Title" /> <asp:CommandField ShowEditButton="True" /> <asp:CheckBoxField DataField="C_isActive" HeaderText="Active" /> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <EditRowStyle BackColor="#2461BF" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" /> <AlternatingRowStyle BackColor="White" /> <PagerSettings Position="TopAndBottom" /> </asp:GridView> </asp:Panel> <br /> <asp:LinkButton ID="insertLnkBtn" runat="Server" OnClientClick="ShowPanel();">Create New Campaign</asp:LinkButton> <script language="javascript" type="text/javascript"> function ShowPanel(){ document.getElementById('ctl00_ContentPlaceHolder1_insertPnl').style.visibility = "visible"; } </script> </div> <br /> <asp:Panel ID="insertPnl" runat="server" CssClass="popupControl"> <asp:DetailsView ID="DetailsView1" runat="server" CssClass="DetailView" AlternatingRowStyle-CssClass="DetailViewEven" HorizontalAlign="Center" GridLines="None" DataSourceID="DS_GetAllCampagins" DefaultMode="Insert"> <Fields> <asp:CommandField ShowInsertButton="True" HeaderText="Create New Campaign" ShowHeader="True" /> </Fields> <AlternatingRowStyle CssClass="DetailViewEven" /> </asp:DetailsView> </asp:Panel> <atlas:UpdateProgress ID="updating" runat="server"> <ProgressTemplate> Updating DataBase<img src="../images/ball2.gif" height="40" width="40" /> </ProgressTemplate> </atlas:UpdateProgress> <asp:XmlDataSource ID="DS_GetAllCampagins" runat="server"> <Data> <root> <item C_SiebelID="a" C_Title="b" C_isActive="false" /> </root> </Data> </asp:XmlDataSource> </div> </form></body></html>

Thank you very much Smile