Tuesday, 4 June 2013
Configuring Commands and attaching to the Keyboard and Mouse events in Windows Presenation Foundation.
Wednesday, 22 February 2012
Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data ...
If you are using repeater control, make sure you have set EnableViewState ="false"
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound" EnableViewState ="false" >
There is no need to change the web.config file.
Tuesday, 8 November 2011
Zenab's Tech Blog.Net: ASMX web service is not returning JSON data in IIS...
Tuesday, 11 October 2011
ASMX web service is not returning JSON data in IIS7
This code was perfectly working and returning json data when was being called from Jquery in IIS 5-6.However when it was deployed to IIS7, it was constantly returning xml response.
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class SomeService : System.Web.Services.WebService
{ public SomeService()
{ //Uncomment the following line if using
designed components //InitializeComponent(); }
[WebMethod] [System.Web.Script.Services.ScriptMethod
(ResponseFormat = ResponseFormat.Json)]
public List<sometype> getlist2()
{ List<sometype> localtaglist =
new List<sometype>(); ... foreach (...)
{ sometype localtag = new sometype(); ... localtaglist.Add(localtag); }
return localtaglist
}
Add following lines of code to the web method and it will successfully
return data in json format. Context.Response.ContentType = "application/json"; JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
Context.Response.ContentType = "application/json";
Context.Response.Write( jsonSerializer.Serialize(localtaglist));
Thursday, 9 June 2011
HTTP Error 404.11 - Not Found The request filtering module is configured to deny a request that contains a double escape sequence.IIS7
<system.webServer> <security> <requestFiltering allowDoubleEscaping="true"> </requestFiltering> </security> </system.webserver>
Thursday, 10 February 2011
Intelligencia UrlRewriter and 404 page not found Error
1-Run->inetmgr.
2-Select web site you are working on.
3-Right click on it and select properties.
4-Click on "Configuration" button .
Now we need to tell IIS that aspnet_isapi.dll should also execute those pages which has no aspx extension.
5-From Application Mapping tab , click Add button,in application mapping pop window,browse
,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll in executable .
6.type .* in extension.
7.Uncheck the"Check that the file exists".
Here we go.........................Run the Site.
Note all web.config configuration should also be done according to rewriter configuration.
Tuesday, 12 October 2010
fix for The state information is invalid for this page and might be corrupted Error
Problem :You might have embedded a page which contains "runat= "server" within a Masterpage.
For example f you have a placed jquery tabs in master page and jquery tabs pointing to an aspx page with
Friday, 8 October 2010
Fix for URL Rewriting With Intelligencia dll and IIS 5.1 Problem
Sunday, 18 July 2010
Books for MONO Cross platform development using C#
# Practical Mono
Practical Mono
# Quick-> Concise->Practical Mono
Mono sams
Applications can also be developed for iphone.
Wednesday, 14 April 2010
ASP.NET Forms Authentication:Padding is Invalid and can not be removed Error.
I was getting this error using
FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt(authCookie.Value);
.I was trying Forms authentication to pass encrypted ticket between two web applications.I left out
<machineKey
validationKey="AutoGenerate,IsolateApps"
decryptionKey="AutoGenerate,IsolateApps"
validation="AES"
decryption="Auto" />
This configuration means to create different key for each web applications thus it failed as
encrypted key was not same in two web applications.
so how to get same key for forms authentication. I resolved this issue by setting static values in section in both web.config files.
<machineKey validationKey='B5D752F96C1196D2A98014A3EF96F35192183FA47D467ACF0969F3687EC3C6BA3A959CD85BD3C282F2390B220ACD742568A8BC36BDBFBF9306ED807E6B090D56' decryptionKey='4BE38697FCD33A2C61D8FC93754FA668CEE4B5467B6B81F6' validation='SHA1'/>
Validation and decryption were generated using online machinekey generator tool.
Saturday, 24 October 2009
"Control can not be created because visual studio can not find the controls 's type in control assembly"
This error message was suddenly popping up in visual studio when I tried to drag my custom web control on a web page then tried to compile the code and found two main error messages in error list. Some thing like
"only one section per config file is allowed" since I had just added
<httpModules >
<add type="URLRewrite" name="URLRewrite" />
<httpHandlers>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add type="URLRewrite" name="URLRewrite" />
These two sections of httpmodules
