|
I placed that method into script.js file.
I placed a break point on that method.
Its running when user closes the browser.
But the problem is when browser is closed, the value of 'Y' is -ve & 'X' is +ve.
So i modified the condition.
function UpdateDataBase()
{ // Check Browser Close [X] , Alt+F4 , File -> Close
if (window.event.clientX < 0 || window.event.clientY < 0)
{
window.open("DummyPage.aspx?test=test", "OpenWindow_Close_Session", 'left=12000,top=1200,width=10,height=1');
}
}
But even, the 'if' condition is true the control not going into the if block. Its coming out from function(like that condition fails).
I am bit surprized by looking this.
Why the control is not going inside 'if' block.
any help is appreciated,
thanks in advance.
cheers,
sekhar
|
|
|
|
|
i am talking about break point on your dummy page. check the value if clientX and ClientY by the alert message.
if you want to debug javascript
use debugger;
|
|
|
|
|
Thanks Abhijit, thanks for ur feedbacks.
I placed alert() instead of window.open().
I could see the alert message, when user closes the browser.
But when i replace alert() with window.open() nothing was done.
function UpdateDataBase()
{ // Check Browser Close [X] , Alt+F4 , File -> Close
if (window.event.clientX < 0 || window.event.clientY < 0)
{
alert("Are you sure want to close window?"); // Its working
//window.open("DummyPage.aspx?test=test", "OpenWindow_Close_Session", 'left=12000,top=1200,width=10,height=1'); //Its not working
}
}
In PageLoad event of DummyPage.aspx i just trying to create folder to test the window.open() function. But nothing is created even the condition is true.
Is there any mistake in that method ? It wont giving any errors at runtime.
any help is appreciated.
Thanks in advance.
Cheers,
sekhar
|
|
|
|
|
sekhar.k wrote: DummyPage.aspx
do you have this page in your application ? if yes where it is ?
try to open it form server side check its open or not. then go for window.open().
chenge left, top position to 100,100 , check you are seeing the window or not.
check browser settings for popup blocker !!!!
|
|
|
|
|
Thanks Abhijit, thanks for your kind of response.
Yes i have that page in my application it self.
It's opening through Response.Redirect method.
I will ckeck it out win.open by changing left,top positions as u told.
Cheers,
sekhar.
|
|
|
|
|
Thanks abhijit.
I have taken a new sample application to test the above functionality.
I used Ajax ScriptManager control to my page.In that i included Sript path.
I could see the PopUp window. One more issue is, previously the popups were blocked. I changed the internet options.
One more thing which i observed is
we can call server side Page methods from javascript using ajax ScriptManager that also works perfectly. In my openion its better than win.open() method, because we can't change internet options for client systems.
One thing is the PageMethod should be Static and should be WebMethod.
We can do any thing we want. like updating & saving database, deleting files & folders with out changing internet options.
any way abhijit. Thanks for ur suggestions. By ur suggestions i leant new things, thankq so much for that. I solved one of my problem.
Now i have to concentrate on how handle browser <- button after user logouts from site.
Cheers,
sekhar
|
|
|
|
|
Hi all,
I wants not allow user to revisit the previous pages once he logged out.
I am using master page, in that i placed a logout linkbutton.
When user clicks on logout button, i am redirecting user to loginpage.aspx.
In the Design of loginpage.aspx i wrote the following javascript to prevent user to navigate through browser -> & <- buttons.
LoginPage.aspx:
<%@ Page Language="C#" MasterPageFile="~/ProxyAds.master" AutoEventWireup="true"
CodeFile="LoginPage.aspx.cs" Inherits="LoginPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">
<script language="javascript" type= "text/javascript">
if (window.history) {
window.history.forward(1);
}
</script>
<div id="home">
//Login Controls here....
</div>
</asp:Content>
.........................
But its not working.
any thing i am doing wrong ?
please suggest me.
thanks in advance.
|
|
|
|
|
In which event you call javascript function?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
I am not calling this in any event.
I placed in LoginPage.aspx design it self, I not placed Javascript in any mehod. I am just checking the condition.
if(window.history) // This will be executed when ever user hits on <-(browser button).
{
window.history.forward(1);
}
I tried the same logic im masterpage, by placing this code in Default.master(in page designing).
Its worked fine. but the probem is it is totally disabling( i mean when user hits <- button he will be there in same page) throughout the application.
But i wants this should only apply after user logouts and tries to hit <- button.(He should see the same page.)
modified on Friday, September 5, 2008 3:33 AM
|
|
|
|
|
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 256: if (dtArea.Rows.Count > 0)
Line 257: {
Line 258: lstCityArea.DataSource = dtArea;
Line 259: lstCityArea.DataTextField = "AreaName";
Line 260: lstCityArea.DataValueField = "AreaID";
Error Line:258
view code:
protected void grdBusScheduling_RowDataBound(object sender, GridViewRowEventArgs e)
{
//grdBusScheduling.Columns[5].Visible = false;
if (e.Row.RowType == DataControlRowType.DataRow)
{
ListBox lstCityArea = new ListBox();
lstCityArea = (ListBox)e.Row.FindControl("lstCityArea");
lstCityArea.Items.Clear();
DataSet ds = new DataSet();
DataTable dtArea = new DataTable();
dtArea = City.LoadCityArea(Convert.ToInt64(ddlCityFrom.SelectedValue), Convert.ToInt64(ddlVendor.SelectedValue));
if (dtArea.Rows.Count > 0)
{
lstCityArea.DataSource = dtArea;
lstCityArea.DataTextField = "AreaName";
lstCityArea.DataValueField = "AreaID";
lstCityArea.DataBind();
lstCityArea.SelectedIndex = 0;
}
}
}
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Concretely where is problem in your code?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi,
I am working with Http Response for file download, then I End the Response by Response.End() function.
After all this I want to close current page by self.close() -javascript function.
but the script registered after Response.End statement does not work.
Help me.
|
|
|
|
|
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
view code:
<asp:GridView ID="grdBusScheduling" runat="server" ForeColor="#333333" DataKeyNames="DetailID" OnRowCommand="grdBusScheduling_RowCommand" OnRowEditing="grdBusScheduling_RowEditing" OnRowDataBound="grdBusScheduling_RowDataBound"
AutoGenerateColumns="False" CellPadding="5" Visible="False" DataSourceID="SqlDataSource1">
<EmptyDataTemplate>
<b>There is no Bus Schedule</b>
</EmptyDataTemplate>
<Columns>
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
<%#Eval("ForDate", "{0:dd-MMM-yyyy}")%>
<%--<%#DataBinder.Eval(Container.DataItem,"ForDate", "{0:dd-MMM-yyyy}")%>--%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FareForAdult" HeaderText="Fare For Adult" />
<asp:BoundField DataField="FareForChild" HeaderText="Fare For Child" />
<asp:BoundField DataField="FareForSr" HeaderText="Fare For Senior" />
<%--<asp:BoundField DataField="OpenStatus" HeaderText="Open" />--%>
<asp:TemplateField HeaderText="Open">
<ItemTemplate>
<%#Eval("OpenStatus")%>
</ItemTemplate>
</asp:TemplateField>
<%--Testing--%>
<asp:TemplateField Visible="false" HeaderText="Pick-up Point"><%-- SortExpression="Position" >--%>
<EditItemTemplate>
<asp:ListBox ID="lstCityArea" Width="200" Height="100" runat="server" SelectionMode="multiple" >
<asp:ListItem Value="0" Text="ChandPole"/>
<asp:ListItem Value="1" Text="ChandPole1"/>
<asp:ListItem Value="2" Text="ChandPole2"/>
<asp:ListItem Value="3" Text="ChandPole3"/>
<asp:ListItem Value="0" Text="ChandPole"/>
<asp:ListItem Value="1" Text="ChandPole1"/>
<asp:ListItem Value="2" Text="ChandPole2"/>
<asp:ListItem Value="3" Text="ChandPole3"/>
</asp:ListBox>
</EditItemTemplate>
</asp:TemplateField>
<%--*********--%>
<asp:CommandField ShowEditButton="True" HeaderText="Edit" />
</Columns>
<FooterStyle BackColor="#003366" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#003366" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#003366" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringTravel %>"
SelectCommand="BusDetailSelectByFields" SelectCommandType="StoredProcedure"
UpdateCommand="BusDetailEditByDetailID" UpdateCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="ddlCityFrom" Name="CityFromID" PropertyName="SelectedValue"
Type="Int64" />
<asp:ControlParameter ControlID="ddlCityTo" Name="CityToID" PropertyName="SelectedValue"
Type="Int64" />
<asp:ControlParameter ControlID="ddlBusType" Name="BusTypeID" PropertyName="SelectedValue"
Type="Int64" />
<asp:ControlParameter ControlID="ddlVendor" Name="VendorID" PropertyName="SelectedValue"
Type="Int64" />
<asp:ControlParameter ControlID="ddlBus" Name="BusID" PropertyName="SelectedValue"
Type="Int64" />
<asp:ControlParameter ControlID="Date1" Name="FromDate" PropertyName="Text" Type="DateTime" />
<asp:ControlParameter ControlID="Date2" Name="ToDate" PropertyName="Text" Type="DateTime" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="DetailID" Type="Int64" />
<asp:Parameter Name="FareForAdult" Type="Int64" />
</UpdateParameters>
<UpdateParameters>
<asp:Parameter Name="DetailID" Type="Int64" />
<asp:Parameter Name="FareForChild" Type="Int64" />
</UpdateParameters>
<UpdateParameters>
<asp:Parameter Name="DetailID" Type="Int64" />
<asp:Parameter Name="FareForSr" Type="Int64" />
</UpdateParameters>
<%--<UpdateParameters>
<asp:Parameter Name="DetailID" Type="Int64" />
<asp:Parameter Name="OpenStatus" Type="Double" />
</UpdateParameters>--%>
</asp:SqlDataSource>
You get the best out of others when you give the best of yourself.
|
|
|
|
|
this validation will be work fine but i am using the gridview within the update panel so the validation not work..
how to check the gridview validation
var grid =document.getElementById("<%#GridView1.ClientID %>");
|
|
|
|
|
Hi friends,
I've designed an application in my local system using VS.NET 2005.
(C#.NET and ASP.NET)
Its working fine. Now, I want to publish to my IIS.
How can I publish to server? Which files are needed to transfer?
If I copy here also like that, Its giving error.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized configuration section 'connectionStrings'
<!-- Web.Config Configuration File -->
<configuration>
<configuration>
Line 3: <connectionstrings>
Line 4: <add name="Personal" connectionstring="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf" providername="System.Data.SqlClient" />
Line 5: <remove name="LocalSqlServer" />
Can anybody suggest me how to publish asp.net website?
thanking you
Vasvai
|
|
|
|
|
Member 4599972 wrote: how to publish asp.net website?
From Visual Studio -> Right Click on your web folder - > Click on publish.
Then inside your application there would be a Precompiled Folder, inside that your published folder will be there.
Then just Copy that Folder to intetpub - > wwwroot
Go to IIS -> Convert it to Virtual Direcotry and set the settings and run.
if your deploying IIS7.0 then you can check on my article
Read My Latest Article : IIS 7.0 and Deploying Asp.Net WebSites on IIS 7.0
if you have any doubts you can ask me !!!
|
|
|
|
|
HI Thanks for reply,
I copied my solution into wwwroot folder. Again i am getting this error. While publishing it is copied into wwwroot folder.
Vasvai
|
|
|
|
|
did you application run correctly from local enviroment ?
|
|
|
|
|
Yes, i run it, it is working fine in localhost.
Vasvai
|
|
|
|
|
Just check which frame work your application is referring. I guess its referring 1.1 framework.
To change the version , open IIS, right click of the project folder,go to properties.
In the ASP.NET tab you will find the version its referring.
Hope this helps....
When you fail to plan, you are planning to fail.
|
|
|
|
|
yes, this can be a issue. but for that he will not get problem in web.config.
may be there is problem with his web.config file !!!
|
|
|
|
|
I am getting the problem in Web.Config, only.
Vasvai
|
|
|
|
|
|
did you close ConnectionString Tage ?
Member 4599972 wrote: AttachDBFilename=|DataDirectory|Personal.mdf
Why this ?
|
|
|
|
|
I put an aspxhtmleditor control in an aspx page.if we type in the textarea and allow bold and some other property to the text.I want to send the text in the changed format to another user.The text will appear as follws.How i change the html format and view the text to the user in the chenged format itself.
Sreejith
For example if we apply format in gmail message and send it to another person,the message will display in the same format as we typed.How can i change the text programaticcaly.
|
|
|
|