|
If you do, the user will be asked if they want to close the form. Why do you need to do that ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
It is required as i m opening this form using window.open alongwith my main form to save partner record and on its close button i hav applied some javascript fucntion so that it could be get on main page. But in case it closed directly from window's close(X) then that function is not executed and some other reasons also forced me to get it close on Submit button's click aftr records are saved.
So if you can help me out , i wud b really thankful to you.
|
|
|
|
|
OK, in that case, do what the other guy said. The event that does the save, inserts the script to close the form into the page, so it closes on reload.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Can u help me plz that how could i add my javascript function with clientsidde script.
Or can u tell me how could i call the close button event after my submit operation completes.
|
|
|
|
|
hi,
The function will work like this:
syntax:
ClientScript.RegisterClientScriptBlock(
Me.GetType(), "Ur ScriptName", "<script>Ur javascript code for closing page </script>")
|
|
|
|
|
use javascript on that button click to close that form.
|
|
|
|
|
plz refer the foll code of default.aspx page:-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script language="javascript">
function hi()
{
window.close();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:Button ID="Button1" runat="server" OnClientClick="javascript:hi()" Text="Submit" /></div>
</form>
</body>
</html>
|
|
|
|
|
Hi, I designed a login form in my website. when a user login active field in a table will be set to true. Its working.
But i keep my logout control in the master page. So how to set active field to false when the user logout from any page. Can anyone give idea ?
|
|
|
|
|
Write down your code in the master page itself...
Balasubramanian K.
|
|
|
|
|
But in master page how can access the Session variables of all the forms? For example if Iam in Form5, and there is session variable of the user name,How can i fetch the value of session variable to set the active field false? Can u send the code?
|
|
|
|
|
Hi,
you can write the logout functionality in master page itself ie; you can set the active filed to false is master page it self only...
|
|
|
|
|
But in master page how can access the Session variables of all the forms? For example if Iam in Form5, and there is session variable of the user name,How can i fetch the value of session variable to set the active field false?
|
|
|
|
|
You can access the Session normally as you would do in the form 5.
As long as the value is added to the session you will be able to access it from anywhere in you code using the session property.
Regards,
Cybernate
|
|
|
|
|
Hi,
you can use this code for clearing all the cookies and session variables...
Response.Cookies.Remove(FormsAuthentication.FormsCookieName)
Response.Cookies.Remove("YOUR COOKIE NAME")'for a particular cookie
Session.RemoveAll()
Session.Abandon()
|
|
|
|
|
I write this for erase the session variable. Its working.
Session.Abandon();
But i want to set the active field in the database table to false. How it is possible?
|
|
|
|
|
Hi Karthick,
keep the user info ie; userid etc in session variable,by accessing that userinfo in master page you can upadte your database for the particular user active field to false ...
|
|
|
|
|
Yes I keep the UserId in the Session variable of the Home page. But i cant access it from the Master page. Shall u tell me how u can access it? Pls..
|
|
|
|
|
Session variables are not bound to forms. They're Session variables.
What's your question?
You access the Session variable from anywhere in the project.
Before you do
Session.Abandon(); use the UserId to set the login flag to false.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi,
assign session("your session variable name") to some object or some string
after that by using that string value you can update the database...
at last write session.abandon()
|
|
|
|
|
|
Hie all,
I want to know how to store the below Chinese text in SQL DB.
,章e瑡H--|? ?珪嘏|p裫y?饠┸舯8!彏鸧8u?鐢鶟钖cK\璃锟{☆瓛?瘱搖f?QC:緐孃走揄Hy誯葏務名DW5[?鼬艅0櫘3???騒虔€?
When storing i get only ? symbols.
With Regards,
M. Gangadhar.
Share knowledge to grow
|
|
|
|
|
Keep it in a NVarChar column.
|
|
|
|
|
It is inserting as symbols. ok but while you retrieve the into the front end, how it comes?...in chinese or symbols...
Balasubramanian K.
|
|
|
|
|
First, force your app to use UTF-8.
Put this in web.config 's system.web element:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8"/>
Second, use nchar/nvarchar types instead of char/varchar .
Third, if you build your queries as text remember to put "N" before strings, like: column=N'text' (there is no problem if you use stored procedures and parameters from C#/VB#)
Fourth, use proper collation on table/database to get vaild sorting.
Hope this helped...
JK
|
|
|
|
|
I am using visual studio 2008( installedtoday).There are no controls in the toolbox(even label and textbox).How to populate my toolbox.
|
|
|
|