|
If you add <%@ MasterType VirtualPath="~/MasterPage.master" %> into the content page (with correct path and filename of course.
Then you can access your label from the content page using Master.Label.Text.
Another method is to use a session variable which can be set from the content page and read from the master page.
|
|
|
|
|
In the master code-behind you could check Request.IsAuthenticated in OnLoad(), if true then set the label.Text = Page.User.Identity.Name.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi all,
I am trying to gather which of the check boxes within the data grid is checked. As far I have tries the following without success:
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox c = (CheckBox)GridView1.Rows[0].Cells[0].FindControl("chkSelection") as CheckBox;
if (c.Checked)
{
Response.Write("Hello");
}
}
How can I know which check boxes were checked in the grid?
Many thanks in advance
Kind regards,
|
|
|
|
|
Where did you write these line of code?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
The code is in a click event of a button on the server side.
regards
JP
|
|
|
|
|
why don't you add columns through property window of datagridview control where you define column name and column type.
For e.g
//Client Side Code
this.dgvVesselDetails = new System.Windows.Forms.DataGridView();
this.IsSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
dgvVesselDetails .Columns.AddRange(new System.web.Forms.DataGridViewColumn[] {
this.IsSelect}
//
// IsSelect
//
this.IsSelect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
resources.ApplyResources(this.IsSelect, "IsSelect");
this.IsSelect.Name = "IsSelect";
//Server Side Code
foreach (DataGridViewRow row in dgvVesselDetails.Rows)
{
if(row.Cells["IsSelect"].Value)
{
//do stuff
Response.write("Hello World");
}
}
Regards
Annpurna
|
|
|
|
|
Hi All,
I want to install windows service on server.
Is there any tool use for running and installing the service?
On the local machine It works Successfully Now I want to install on the server.
Thanks
Sjs4u
|
|
|
|
|
sjs4u wrote: On the local machine It works Successfully Now I want to install on the server.
How did you install it local system ? you have to do the same thing also in server.
sjs4u wrote: Is there any tool use for running and installing the service?
Go to Visual Studio Command Prompt > Run command : installutil <your servicename.exe=""></your>
BTW : It's not a ASP.NET Question.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I have a standard datagrid populated from an access database. When i click on edit the datagrid rows are exposed as text boxes and expand across the whole page, is there any easy way to stop this from happening or to limit the size of each tect box while updating
|
|
|
|
|
Use ControlStyle-Width for edit mode width of the boundfield
Use ItemStyle-Width for display mode width of the boundfield
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hi,
We are using localization in asp.net with resource files.
We have a default.resx resource file for a default.aspx page and a default.aspx.hi-in.resx to support hindi.
The problem is that when we type in hindi in the resource file we see junk characters.
So do we have to install any language pack to the .net solutions in order to support hindi language or fonts.
And also how to load data dynamically to drop down list using resource files for multi-lingual site.
thanks,
sabiha.
|
|
|
|
|
Dear Friends,
I have a web application running from 10 different places. Application Server is their local server. But Database server is same for all. There is only one login ID created for all users to access pages (Form Based Authentication).
Will be any Problem in Sessions ?
Because on my system I logged with that user name. I have used Login View to show login status. I have written logged in Template and Anonymous user Template. When I login it is showing correcty with my name. After some time it is displaying as Guest (login). But I have not logged out. I dont know why it showing so....
Please help me out....
Nayak
|
|
|
|
|
It's more likely that your session has simply died.
Far as I'm concerned, the default timeout for sessions is 10 minutes (or is it 20? I'm not sure).
So even though you have not logged out manually, I am sure you have some facilities in place to do that for you, if the login session is dead.
Now ask yourself how long you had been logged in without performing any postbacks on the page to keep the session alive and see if it exceeded 10 minutes.
... and don't say your query is urgent. It might be to you, but it's totally irrelevant to others.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi,
You are right. But in Web.Config file I have mentioned this line.
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="UseCookies" timeout="1400" />
Still what could be the problem ?
Ramesh Sambari
|
|
|
|
|
It might be because someone else might be logging out , and hence the session object is disposed ..
So you are showed as guest then . .
|
|
|
|
|
Hi,
I have checked this Site on my System. I am the only person logged in. No other user logged in. Even I mentioned the session time to 1400. Still how it is expiring ?
Ramesh Sambari
|
|
|
|
|
You need to check every events in which you are trying to kill the session..
You might be unknowingly calling such events..
Time out is not the problem...
|
|
|
|
|
Hi,
Ya..In Application_Exit event I wrote Session.Abondon() method. After you told, I have removed that. And no more session abondons. But still same problem.
Please help me out...
Ramesh Sambari
|
|
|
|
|
|
Seriously, you post is nothing but a spam for me. Please read forum guideline, and know how to ask good question.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
hi,
first of all let me know what is ur question .
cheers
venu gopal reddy.......
|
|
|
|
|
Was there a purpose in posting this crap?
|
|
|
|
|
The funny thing is, you keep asking idiotic questions, but you never answer anyone who replies. Please stop it, and go away. If you're not trolling, then you're so stupid that I don't know how you manage to use a keyboard.
Or, you could try to buy some books, do some research, learn how to use google, ask intelligent questions and respond when people try to help you.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I want to create glossary in my application,in that from A-Z,am generating link buttons dynamically,on particular alphabet click,i have to list down statring with that letter.
How to rise that event..
Any alternative way to create glossary,user may add new glossary items too..
Asp.net ,C#
Thanks in advance
|
|
|
|
|
sudheera p wrote: I want to create glossary in my application,in that from A-Z,am generating link buttons dynamically
When you are creating those control?
cheers,
Abhijit
CodeProject MVP
|
|
|
|