Friday, October 19, 2007

Solution For Sys.WebForms.PageRequestManagerTimeoutException

< asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeOut="300" >

</
asp:ScriptManager>

By Default AsyncPostBackTimeOut Property Value's 90 sec



Ajax UpdatePanal Custom Error Handling

Put This Code Within Inline Form Tag,
Note:Dont Put This JavaScript As a Seperate js File in your project,
use within a form tag

<form id="form1" runat="server">
<script language="javascript" type="text/javascript">


function pageLoad(sender, args)
{

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);

}

function beginRequest(sender, args)
{

.
.
.


}

function endRequest(sender, args)
{

var e = args.get_error();

if (e != null)
{
args.set_errorHandled(true);
alert('Custom Error');
}

}
</script>
</form>



Friday, October 5, 2007

set session timeout in webconfig

<configuration>

<system.web>

<sessionState mode="Off|InProc|StateServer|SQLServer"
<!--
Mode : Specifies where to store the session state.
Off : Indicates that session state is not enabled.
InProc : Indicates that session state is stored locally.
StateServer : Indicates that session state is stored on a remote server.
SQLServer : Indicates that session state is stored on the SQL Server.
-->
cookieless="true|false"
<!--
cookieless : Specifies whether sessions without cookies should be used to identify client sessions.
true : Indicates that sessions without cookies should be used.
false : Indicates that sessions without cookies should not be used. The default is false.
-->
timeout="number of minutes"
<!--
timeout : Specifies the number of minutes a session can be idle before it is abandoned. The default is 20.
-->

stateConnectionString="tcpip=server:port"

<!--
stateConnectionString :Specifies the server name and port where session state is stored remotely.
For example, "tcpip=127.0.0.1:42424". This attribute is required when mode is StateServer.
-->
sqlConnectionString="sql connection string"

<!--
sqlConnectionString : Specifies the connection string for a SQL Server.

For example, "data source=localhost;Integrated Security=SSPI;Initial Catalog=northwind".
This attribute is required when mode is SQLServer.
-->
stateNetworkTimeout="number of seconds"/>

<!--
stateNetworkTimeout : When using StateServer mode to store session state,specifies the number of seconds the TCP/IP network connection between the Web server and the state server can be idle before the session is abandoned. The default is 10.
-->
</system.web>

</configuration>


Monday, October 1, 2007

return values from popup to the parent page(Child To Parent)

This Program Ilustrate a Html Parent Page & Child Page return values from popup to the parent page, when you click a Parent Click Button In A Parent.html, The Child.html page will popped up, Enter any value in the Text Box in the Child.html, then click Child click button, the value entered in the textbox(child.html) will be passed to the textbox(parent.html).

Parent.html
~~~~~~~~~

<html>

<head>

<script language="javascript">

function test()

{

var FrmChild = window.showModalDialog('child.html',null,'status:off;center:yes;scroll:no;');

if(FrmChild != null)

{

document.getElementById('Ptxt').value = FrmChild;

}

else

{

return false;

}

}

</script>

<head>

<body>

<input type="text" id='Ptxt'/> <input type="button" onclick="test();" value="Call Child Window" />

</body>
</html>




Child.html
~~~~~~~

<html>

<head>

<script language="javascript">


function Child()

{

var Str = document.getElementById('ctxt').value; window.returnValue = Str;

window.close();

}
</script>


<head>

<body>

Enter Any Value To Pass To The Parent Window<br />

<input type="text" id='ctxt' />

<input type="button" onclick="Child();" value=" Child Click" /> </body>

</html>


Program Demo

Note : IE Supported


Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.