|
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.
|
|
|
|
|
open w a new website and go design view of the page..and then see ur toolbar may be this is the problem.
|
|
|
|
|
had posted this yesterday but since my ques wasnt proper didnt get many answers..well i want populate my textboxes based on the sessionid with data from database..through that id am populating the textboxes which are the fields in the table..am using datareader's reader method but havin problem..do help..below is the code..
if (Session["User"] == null) Response.Redirect("Default4.aspx");
filltrans(System.Convert.ToString(Session["User"]));
private void filltrans(string User)
{
try
{
SqlDataReader reader;
string ConnectionString="...";
SqlConnection con = new SqlConnection(ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("View", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter[] userdetail = new SqlParameter[1];
userdetail[0] = new SqlParameter("@User_ID", SqlDbType.VarChar,50);
userdetail[0].Value = User.ToString();
reader = cmd.ExecuteReader();
while(reader.Read())
{
txtuser.Text = System.Convert.ToString(reader["user"]);
txtusername.Text = System.Convert.ToString(reader["user_new"]);
txtmobileno.Text = reader["MobileNo"].ToString();
}
reader.Close();
}
catch (Exception ex)
{
}
}
when i compile and check with breakpoints i found that after the executeReader method its not goin into while loop at all..
thanks..
scarface
modified on Tuesday, March 10, 2009 1:10 AM
|
|
|
|
|
Check your Stored Procedure.
It might be possible your stored procedure is not returning any row for that User.
|
|
|
|
|
had done a mistake in this line
userdetail[0] = new SqlParameter("@User_ID", SqlDbType.VarChar,50);
had to add cmd.parameters.add..and got the result..
thx for the help..
scarface
|
|
|
|
|
All
I have a website that works perfect on IIS6 with Windows 2003 server, I am trying to move the website to Windows 2008 server with IIS7, everything works fine except the images does not display in the webpages, I did some search and installed static content, tried adding new handlers etc. without any success,
Here is the picture control code
<asp:image height="240" width="320" id="FacilityPicture" runat="server" visible="false" alternatetext="Picture of Facility At Time Of Inspection" xmlns:asp="#unknown">
And here is how I am calling the picture
FacilityPicture.ImageUrl = "facility.imgx?pictureId=" + facility.MainPicture.ReplicationId.ToString();
I have added the imgx handler in the web.config
add verb="GET" path="*.imgx" type="*****.Web.DatabaseImageHttpHandler, *****.Web, Version=1.2.0.0, Culture=neutral, PublicKeyToken=89330ffe59e80120" /
I replaced the DLL name with *s.
All the pictures are displaying the "alternatetext" value and not the picture itself.
Appreciate any help
Thanks in advance
Sri
modified on Monday, March 9, 2009 6:55 PM
|
|
|
|
|
Maybe I'm being silly, but doesn't visible="false" not show the images?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thanks, But I do enable the control in code behind before I assign the image to it, Like I said it shows the Alternatetext value but not the picture.
Sri
|
|
|
|
|
IIS7 requires more configuration to get HttpHandler s working. In your case, Web.DatabaseImageHttpHandler will not be configured correctly. Try to follow the below steps,
1 - Type inetmgr to open IIS configuration
2 - Click on Handler Mappings
3 - Choose Add managed handler under Actions. Specify the required details.
Now try to refresh your page.
|
|
|
|
|
|
First try browsing the image directly using the URL below:
http://<your server="" name="">/facility.imgx?pictureId=<your picture="" id="">
This will display if there is any error in the processing and you can start your debugging from there.
Regards,
Cybernate
|
|
|
|
|
I'm looking for some simple code to use to record audio through a web page. Basically, a dictation system over the web. I've seen two vendors with such programs, but I really didn't want to pay like $485 for this.
|
|
|
|
|
Well, there;s not any ASP.NET code that can do this, by definition. You need to write an activeX control that does it, and host it on your page.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am putting together an article about master and content pages, and I want to make sure the info I'm including is correct. Also, if this is useful in any way, I can expand on it a bit and make it an article unto itself. The information has been culled from MS documentation, meaning that accuracy and completeness is iffy at best. So any comments or suggestions would be appreciated.
----------
As ASP files go from a request to something sent to the browser, several events are raised. All pages will raise the events I've marked below as Content and Page; Master events will be raised only if the page has a Master Page. Events marked as Page show where the server does something important and are not trappable events.
Content PreInit
The first capturable event. The Request and Response objects are available. IsPostBack and UICulture objects have been initialized. ViewState is not available. This is the only event where you can set the master page dynamically, as it occurs before any master page event has been raised. This is also when you would set the page's theme and create dynamically created controls.
Master Init
Initialize the master page and set any properties that it will require. ViewState is not available. Server controls on the master page have been fully initialized and can be accessed as needed, but the controls' values have not yet been set.
Content Init
Initialize the content page and set any properties that it will require. ViewState is not available. Server controls on the content page have been fully initialized and can be accessed as needed, but the controls' values have not yet been set.
Content InitComplete
The page has been fully initialized.
Page ViewStateRestore
This is not a trappable event. The ViewState is initialized. If the page request is a postback, the postback data is processed. Server controls with ViewState or postback data have their values set.
Content PreLoad
The ViewState has been restored and postback data has been set.
Content Load
The content page is being loaded. This event is usually where you set properties, open connections, etc. Note that the content page is loaded before the master page.
Master Load
The master page is being loaded. This event is usually where you set properties, open connections, etc. Note that the master page is loaded after the content page.
Page Validation
This is not a trappable event. If your page has any Validation controls, the Validate method is called on them.
Page HandlePostBack
This not a trappable event. After the page's controls have been validated and before rendering begins, any postback events such as button clicks are handled.
Content LoadComplete
The page has been completely loaded.
Page PreRender
This is not a trappable event. The EnsureChildControls method is called on all server controls, on the content page and on the master page. The BindData method is called on controls that are data-bound.
Content PreRender
The page is about to be rendered. Perform final changes to server controls, and save any data you want to persist to the ViewState .
Master PreRender
The page is about to be rendered. Perform final changes to server controls, and save any data you want to persist to the ViewState .
Content PreRenderComplete
This is your last chance to change the page's content; subsequent changes to the page will be ignored.
Content SaveStateComplete
This is your last chance to persist data to the ViewState .
Page Render
This is not a trappable event. The Render method is called on all server controls on the page. In-line commands (those noted in the HTML with <% %> are executed top down.
Master Unload
The page has finished rendering. If you opened any files or data connections for rendering the page, now would be the time to close them and free resources. Use of the Response , Request and ViewState objects will throw an exception. Please note that this event has nothing to do with browser navigation.
Content Unload
The page has finished rendering. If you opened any files or data connections for rendering the page, now would be the time to close them and free resources. Use of the Response , Request and ViewState objects will throw an exception. Please note that this event has nothing to do with browser navigation.
Content Disposed
The cycle is complete, and the page has been fully rendered. Please note that this event has nothing to do with browser navigation.
Master Disposed
The cycle is complete, and the page has been fully rendered. Please note that this event has nothing to do with browser navigation.
When you have nested master pages, the inner master page is treated as the contents of the outer master page. So if you had Content.asp with a master page of Inner.master which, in turn, has a master page Outer.master, the events would be:
Content PreInit
Outer Init (master master)
Inner Init (Outer's content)
Content Init (Inner's content)
Content InitComplete
Page ViewStateRestore
Content PreLoad
Content Load
Inner Load (Content's master)
Outer Load (Inner's master)
Page Validation
Page HandlePostBack
Content LoadComplete
Page PreRender
Content PreRender
Inner PreRender (Content's master)
Outer PreRender (Inner's master)
Content PreRenderComplete
Content SaveStateComplete
Page Render
Outer Unload (master master)
Inner Unload (Outer's content)
Content Unload (Inner's content)
Content Disposed
Inner Disposed (Content's master)
Outer Disposed (Inner's master)
----------
|
|
|
|
|
Good Info.
But I would suggest write an article instead of posting this information in the message board.
One more thing:
It would be great if you would have explained the life cycle of the web controls also along with the Page life cycle and Master pages.
|
|
|
|
|
Hey.
I get this exeption on my Vista machine, this works fine on my XP machine.
On both machines I use Visual Studio 2008, and both uses .Net Framework 3.5.
<!-- HttpException The file '/MyControls/Web/GUI/Controls/PageHead.ascx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile)
at System.Web.UI.BaseTemplateParser.GetUserControlType(VirtualPath virtualPath)
at System.Web.UI.MainTagNameToTypeMapper.ProcessUserControlRegistration(UserControlRegisterEntry ucRegisterEntry)
at System.Web.UI.BaseTemplateParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.TemplateControlParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.PageParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) -->
I have a prodject where my SomePage.aspx site is.
On this page I have a refference to the usercontrol PageHead.ascx witch is located on
another prodject.
<%@ Register TagPrefix="uc1" TagName="pageHead" Src="MyControls/Web/GUI/Controls/PageHead.ascx" %>
I've have added the web prodject to IIS and added the virtual path for the usercontrol prodjekt,
and in the usercontrol prodjekt properies I've sat it to use the IIS Web server and to override the application root URL.
Nothing of this has helped.
Anyone know why?
Thanks
Thomas
|
|
|
|
|