|
thanks for the help.
Vijay V.
Yash Softech
|
|
|
|
|
Hi
I saw many pages about this subject in microsoft msdn website but I don't how to do it.What I mean is I have downloaded virtual pc 2007 already but what next should I do?
I am too late but i will never give up
|
|
|
|
|
Hi all,
I have master page. In that i placed a LinkButton(Log Out).
If user clicks on this logout button, i am entering the login & logout information into database and i am deleting temporary folders.
Probem1 : When user closes Browser window by Closebutton(X), i need to enter the logout information into database & i need to delete temporary folders and files.
Problem2 : After user logout, how can i restrict user to navigate through previous pages by using Brower Back(< & Forward(->) buttons.
Please suggest how to achieve this...
Thanks in advance.
|
|
|
|
|
sekhar.k wrote: Probem1 : When user closes Browser window by Closebutton(X), i need to enter the logout information into database & i need to delete temporary folders and files.
function UpdateDataBase()<br />
{<br />
if(window.event.clientX < 0 && window.event.clientY <0)<br />
{<br />
window.open("UrLogic.aspx", "OpenWindow_Close_Session",'left=12000,top=1200,width=10,height=1');<br />
}<br />
}
Urlogic.aspx will contain the database related operation and Check the locatoion of popup. user should not able to see it.
Call it on Masterpage onUnload
sekhar.k wrote: Problem2 : After user logout, how can i restrict user to navigate through previous pages by using Brower Back(< & Forward(-> buttons.
javascript:window.history.forward(1);
|
|
|
|
|
Thanks for your suggestion. I will try as u told.
But i have a small doubt.
For Problem1, Do i need to place the above javascript code in MasterPage.
For Problem2, Where i nned to place'javascript:window.history.forward(1).
This i have apply only after user logout if he tries to navigate through Browser -> & <- Buttons.
Thanks in advance.
Cheers,
sekhar
|
|
|
|
|
I tried ur logic. Its not working properly.
If any where i went wrong, let me know.
Here is my code
MastrPage:
==========
Default.master(Design)
<%@ Master Language="C#" CodeFile="Default.master.cs" Inherits="Default_master" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type= "text/javascript">
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');
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div class="header">
<h1 style="color: #FFFFFF">Prospecta technologies</h1>
<h2 style="color: #FFFFFF">Proxy Ads Management System</h2>
<div class="nav">
<asp:Label ID="lbl_Welcome" runat="server" Visible="False" Font-Bold="True"
ForeColor="White"></asp:Label>
|
<asp:SiteMapPath id="SiteMapPath1" runat="Server" PathSeparator=" > " RenderCurrentNodeAsLink="true" />
|
<asp:LinkButton ID="hlink_Logout" runat="server"
onclick="hlink_Logout_Click" CausesValidation="False"
ValidationGroup="Click here for Logout" Visible="False">Logout</asp:LinkButton>
</div>
<asp:Menu id="menua" runat="server"
cssclass="menua"
orientation="Horizontal"
maximumdynamicdisplaylevels="0"
skiplinktext=""
staticdisplaylevels="2" >
<Items>
<asp:MenuItem NavigateUrl="~/LoginPage.aspx" Text="Login" Value="Login"
ToolTip="Login">
</asp:MenuItem>
<asp:MenuItem Text="About Us" ToolTip="About Us" Value=" About Us"
NavigateUrl="~/AboutUs.aspx">
</asp:MenuItem>
<asp:MenuItem NavigateUrl="~/ContactUs.aspx" Text="Contact Us"
Value="Contact Us" ToolTip="Contact Us"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
<asp:contentplaceholder id="Main" runat="server" onunload="Main_Unload" />
<div class="footerbg">
<div class="footer">
<asp:Menu id="menub" runat="server"
cssclass="menub"
orientation="Horizontal"
maximumdynamicdisplaylevels="0"
skiplinktext=""
staticdisplaylevels="2" Height="16px" Width="290px" >
<Items>
<asp:MenuItem NavigateUrl="~/LoginPage.aspx" Text="Login" ToolTip="Home"
Value="Home"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/AboutUs.aspx" Text="About Us" ToolTip="About Us"
Value="About Us"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/ContactUs.aspx" Text="Contact Us"
ToolTip="Contact Us" Value="Contact Us"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
</form>
</body>
</html>
My CodeBlock
Default.master.cs:(The below method is not executing when i closes the browser. I tried by placing break point)
==================
protected void Main_Unload(object sender, EventArgs e)
{
string str = "<script language=javascript>";
str += "javascript:UpdateDataBase();";
str += "</script>";
Page.RegisterStartupScript("test", str);
//string script;
//script = @"<SCRIPT language='javascript'> + "function name</SCRIPT>";
//this.RegisterStartupScript("MyAlert", script);
}
//////////////////////////////
DummyPage.aspx.cs(This is the page i am redirecting to user from javasript method)
PageLoad()
{
if(!Page.IsPostBack)
{
if(Request.QueryString["msg"]!="") // I am trying to create a direcory for Checking purpose
{
DirecoryInfo dir = new DirecoryInfo(@"D:\Test");
if(dir.Exists == false)
dir.Create();
}
}
}
..................
Please suggest me where i went wrong.
Thnks in advance.
|
|
|
|
|
sekhar.k wrote: Problem2 :
It is quite difficult to control the back button in the browser.
Even with the javascript line of code posted below there is still no quarantee that a user wont disable the javascript. The best bet is to build your application so it doesnt matter if a user goes back through pages
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
Hi
I have gridview and I am using gridview1_rowupdating event to update the gridview, but when I am using the code given below its not working. I do not know why it is not updating, it is not even showing error. please help me resolve this problem.
Thanks
protected void gv_RowUpdating1(object sender, GridViewUpdateEventArgs e)
{
connectAccessDb();
int i = e.RowIndex;
string id = (gv.Rows[e.RowIndex].FindControl("lblCID") as Label).Text;
string comp = (gv.Rows[e.RowIndex].FindControl("txtCName") as TextBox).Text;
string address = (gv.Rows[e.RowIndex].FindControl("txtCAddr") as TextBox).Text;
string city = (gv.Rows[e.RowIndex].FindControl("txtCcity") as TextBox).Text;
string strQuery = "UPDATE companydetail SET companyname=@comp, companyaddress=@address, companycity=@city where id=@id";
cmd = new OleDbCommand(strQuery, cn);
cmd.Parameters.Add("@id", OleDbType.Integer).Value = Convert.ToInt32(id);
cmd.Parameters.Add("@comp", OleDbType.VarChar).Value = comp;
cmd.Parameters.Add("@address", OleDbType.VarChar).Value = address;
cmd.Parameters.Add("@city", OleDbType.VarChar).Value = city;
cmd.ExecuteNonQuery();
cmd.ExecuteNonQuery();
cn.Close();
bindData();
}
private void bindData()
{
connectAccessDb();
da = new OleDbDataAdapter("SELECT id,companyname,companyaddress,companycity from companydetail order by companyname", cn);
da.Fill(ds, "companydetail");
gv.DataSource = ds;
gv.DataBind();
cn.Close();
}
private void connectAccessDb()
{
cn = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" + strRootDir + "App_Data\\newsdb.mdb");
cn.Open();
}
|
|
|
|
|
How Can I use ListBox for multiple values in gridview in asp.net 2.0
while editing only.
look on below code:
<asp:GridView ID="grdBusScheduling" runat="server" ForeColor="#333333" DataKeyNames="DetailID"
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}")%>
</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>
<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>
</asp:SqlDataSource>
You get the best out of others when you give the best of yourself.
|
|
|
|
|
i have used the following code to verify email domain given in code project articles but it was not working,can u please sort my problem out.....
public static bool Send(string aa)
{
string[] host = (aa.Split('@'));
string hostname = host[1];
IPHostEntry IPhst = Dns.Resolve(hostname);
IPEndPoint endPt = new IPEndPoint(IPhst.AddressList[0], 25);
Socket s = new Socket(endPt.AddressFamily,
SocketType.Stream, ProtocolType.Tcp);
s.Connect(endPt);
}
thanks in advance....
Maniiiiiiiiiiiiiii
|
|
|
|
|
Could you specify what you mean by "not working"? Does it compile? Does it run? What happens? Do you get any kind of error message?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
exception is thrown which shows that domain does not exists even in case of yahoo.com,gmail.com
Maniiiiiiiiiiiiiii
|
|
|
|
|
currently i m using asp.net with c# (2.0 framework).
here i created a datatable and put these values in gridview and i have displayed. But when i check the gridview row and column count, the row count is coming correctly. but the column count always remains 0. y? kindly help me... below i have attached the coding.........
DataTable DTable;
DataRow DRow;
DataColumn DCol;
sqlda=new System.Data.SqlClient.SqlDataAdapter("select tmp_values from tbl_table1", conn);
sqlda.Fill(ds);
DTable = new DataTable("Headers");
DCol = new DataColumn("Head");
DTable.Columns.Add(DCol);
DRow = DTable.NewRow();
for (int i = 0; i <ds.Tables[0].Rows.Count; i++)
{
DCol = new DataColumn("" + ds.Tables[0].Rows[i][0].ToString() + "");
DTable.Columns.Add(DCol);
DCol = new DataColumn("" + ds.Tables[0].Rows[i][0].ToString() + " " + " Remarks");
DTable.Columns.Add(DCol);
}
DTable.Rows.Add(DRow);
GridView1.DataSource = DTable;
GridView1.DataBind();
DTable.Columns.Count = 5 (its correct, but when bind with gridview and check the column count its zero)
GridView1.Rows.Count = 1 (its correct)
GridView1.Columns.Count = 0 (its incorrect, the answer should be 5)
Help me!!! - KARAN
|
|
|
|
|
Hi all,
iam facing problem how i display associated record details from database inside formview control
i have table control contains 32 cells in row and added linkbutton dynamicallly to table cells and added event handler as well but when iam clicking on all linkbuttons only one record is displying inside formview .
but i have to display associated record inside formview on linkbuton click.
Any hint ?
Best Regards
Rameez
|
|
|
|
|
Hi,
I am working on a project and I am showing 4 different datagrid on the page. On the top of page there are 4 button for download, email, print and view full report. and also same option on the each indivisual grid. Our requirement is when user click on the individual button then it will download,print, email or full report will do respected task for perticular grid, but when user click on the top of the page then I want to give download all the four grid in one excel file, I want to send all the data as a email also same for print. I have done some thing for email and print but it't not too good if you have any example ready made then it will graceful. If you can give any suggesion then also it will be grace full.
Please help me it's very urgent
|
|
|
|
|
Hello All,
I am trying to execute Aspnet_regsql.exe by using VS 2005 Command Prompt but ran into a little problem.
The following command is what I wanted to use with a little modification.
aspnet_regsql -E -S localhost -A all
I am trying to replace localhost with machinename\sqlserver instance. The problem I am having is I am uncertain if my machinename and sqlserver instance are supposed to be the same. I went into sql management studio and check registered servers and found that the name of my machine and the name of my sql instance are exactly the same. Is that supposed to be correct or is that wrong. If it is correct and if the name of my machine and the name of sql instance are Server1, can I replace localhost with Server1\Server1? If not what should the command be? Thank you in advance for your help.
|
|
|
|
|
Guys, if I upgrade my local machine do I need to have our servers upgraded?
I didn't get any requirements for the signature
|
|
|
|
|
I installed 3.5 sp1, updated and application, published it to my server and it is still running with no update.
I didn't get any requirements for the signature
|
|
|
|
|
ToddHileHoffer wrote: published it to my server and it is still running with no update.
What it means? Isn't it using the 3.5 assemblies?
|
|
|
|
|
Hi All,
I have an HTML CONTROL <INPUT id="txtName" text="name" ...........
When i go to my code page i cant get this control called Name.
Does it have to be only <asp:textbox ---- to be identified in C sharp ?
Orelse How Can i call HTML controls in a C sharp code page???
Thank you
|
|
|
|
|
add a runat="server" attribute
note that the contents of such a text control will be referenced by .Value and not by .Text
|
|
|
|
|
That's an HTML control. ASP.NET has no idea what you want to do with it. It must be an asp:TextBox control to be visible in C#.
|
|
|
|
|
Thank you.Its Much appreciated.
I am having a javascript thats why i need the control.Can please advice how to use it?
Thank you.
|
|
|
|
|
kibromg wrote: Can please advice how to use it?
Well as you have assigned it an ID of txtName, then you can reference it through JavaScript with document.getElementById("txtName")
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
Pete O'Hanlon wrote: It must be an asp:TextBox control to be visible in C#.
Is that so? Being a lowly VB porogrammer I will bow to your experience, but certainly in VB you can reference HTML controls in ASP.NET code-behind by the method I outlined above.... ( You may need to explicitly add a reference to System.Web.UI.HtmlControls.HtmlGenericControl )
modified on Wednesday, September 3, 2008 12:09 PM
|
|
|
|