|
Hi
In Ahange Modern talking boode.doroste.eshtebah nist.
dar morede ADO.net Entity frame work chzimidooni ke komakam koni
(This is a statemet of Modern Talking music)
m.profess.mrn@gmail.com
Best regards
You are win if you want
|
|
|
|
|
There is a wonderful tool available to you called the Internet. Try searching it.
only two letters away from being an asset
|
|
|
|
|
I have a listbox.
I have used datasource attribute to add items into the listbox. This code
DropDownList1.DataSourceID = "datareader";
DropDownList1.DataTextField = "tenCV";
DropDownList1.DataValueField = "maCV";
DropDownList1.DataBind();
lstChucNang.DataSourceID = "SourceListBox";
lstChucNang.DataTextField = "tenCN";
lstChucNang.DataValueField = "maCN";
lstChucNang.DataBind();
Now I want to get seletedItems from that listbox. So, How can I do?
I have ever tried to use selectedItems attribute but not.
Please, help!
|
|
|
|
|
foreach(ListItem item in lstChucNang.Items)<br />
{<br />
<br />
if(item.Selected)<br />
<br />
{<br />
<br />
}<br />
<br />
}
Hope it will help you
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.
www.aktualiteti.com
|
|
|
|
|
|
Your concretely question is...?
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.
www.aktualiteti.com
|
|
|
|
|
can i access master page variables from appcode files if yes please give me a suggestion
|
|
|
|
|
amarnath n.n wrote: Subject: please ans me
This should not be the subject. You have to ask the qestion in proper way.
amarnath n.n wrote: can i access master page variables from appcode files if yes please give me a suggestion
In App_Code , you should have classes. So make the Public Property Over There, Create object App_Code Class and Asign the Value from Master page. Then you will get variable value on you App_Code .
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
sorry,excuseme!!!
my actual question is how to access controls in master page from appcode class
|
|
|
|
|
The non nasty way to do this, is to have a class derived from Page, which returns a strongly typed version of your master page derived class, instead of just the base master. Then you can access the proprties of the master page neatly in any page derived from your new base class. A new base class lets you define all sorts of things and make them visible to all pages, as well as putting any code to check if a user is logged in, in one place.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class SampleMenuPage1 : System.Web.UI.Page
{
private const string BASE_PATH = "~/DynamicControlLoading/";
private string LastLoadedControl
{
get
{
return ViewState["LastLoaded"] as string;
}
set
{
ViewState["LastLoaded"] = value;
}
}
private void LoadUserControl()
{
string controlPath = LastLoadedControl;
if (!string.IsNullOrEmpty(controlPath))
{
PlaceHolder1.Controls.Clear();
UserControl uc = (UserControl)LoadControl(controlPath);
PlaceHolder1.Controls.Add(uc);
}
}
protected void Page_Load(object sender, EventArgs e)
{
LoadUserControl();
if (IsPostBack)
{
//Sleeps for 1 Seconds
//A Fake Deley to show the UpdateProgress/ModalPopup
System.Threading.Thread.Sleep(1000);
}
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MenuItem menu = e.Item;
string controlPath = string.Empty;
switch (menu.Text)
{
case "Load Control2":
controlPath = BASE_PATH + "SampleControl2.ascx";
break;
case "Load Control3":
controlPath = BASE_PATH + "SampleControl3.ascx";
break;
default:
controlPath = BASE_PATH + "SampleControl1.ascx";
break;
}
LastLoadedControl = controlPath;
LoadUserControl();
}
}
In SampleControl2.ascx ..Even is not firing for first time(dropdown onchange event)
And !ispostback is not working
Ramkumar
|
|
|
|
|
Dude,you already posted your code in previous question.
Be patient and wait for answer.
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.
www.aktualiteti.com
|
|
|
|
|
Hi.
just a thought.
As you told event is not firing on dropdown change. so have you set autopostback property of dropdown set to true. if not plz do so.
"You just become, like a flower becomes the fruit. It's all built in within you. Allow it to work out."
-- Shri Mataji Nirmala Devi.........
for more details visit : http://www.sahajayoga.org
Akhilesh Singh
|
|
|
|
|
Hi All
when i place usercontrol in placeholder.... !postback is not working in the usercontrol ....
Please Let me know ...why !postback condition is not working
Event is not firing for the first time
Thanks
Ramkumar
|
|
|
|
|
getramonweb wrote: Event is not firing for the first time
Your question is not clear. Please explain clearly with relevant code snippets.
|
|
|
|
|
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class SampleMenuPage1 : System.Web.UI.Page
{
private const string BASE_PATH = "~/DynamicControlLoading/";
private string LastLoadedControl
{
get
{
return ViewState["LastLoaded"] as string;
}
set
{
ViewState["LastLoaded"] = value;
}
}
private void LoadUserControl()
{
string controlPath = LastLoadedControl;
if (!string.IsNullOrEmpty(controlPath))
{
PlaceHolder1.Controls.Clear();
UserControl uc = (UserControl)LoadControl(controlPath);
PlaceHolder1.Controls.Add(uc);
}
}
protected void Page_Load(object sender, EventArgs e)
{
LoadUserControl();
if (IsPostBack)
{
//Sleeps for 1 Seconds
//A Fake Deley to show the UpdateProgress/ModalPopup
System.Threading.Thread.Sleep(1000);
}
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MenuItem menu = e.Item;
string controlPath = string.Empty;
switch (menu.Text)
{
case "Load Control2":
controlPath = BASE_PATH + "SampleControl2.ascx";
break;
case "Load Control3":
controlPath = BASE_PATH + "SampleControl3.ascx";
break;
default:
controlPath = BASE_PATH + "SampleControl1.ascx";
break;
}
LastLoadedControl = controlPath;
LoadUserControl();
}
}
In SampleControl2.ascx ..Even is not firing for first time(dropdown onchange event)
And !ispostback is not working
Ramkumar
|
|
|
|
|
you need to initiate a postback from the menu click, so you can (if the control allows it) set the AutoPostBack property to 'true', or you can do it through javascript.
|
|
|
|
|
thanks for your reply...May I know in which place I have to set AutoPostBack property to 'true'
Ramkumar
|
|
|
|
|
this would be on the actual control you are clicking on. If it is a dropdown list, combo-box, etc., it would be in the list of properties underneath the solution explorer in the default layout of visual studio.
you might need to register the event handler for some controls however. You can find info on doing that on the MSDN website. Also, you can look for properties such as 'OnClick', 'OnCheckChanged', etc. in the properties box. You might also look for the button at the top of the properties box that looks like a lightning bolt. This switches the properties to events and you can define methods in the code-behind file to handle the associated event.
You should first start by looking for the AutoPostBack property though as this is what tells the ASP.NET page to make a trip back to the server for more processing.
|
|
|
|
|
Hi,
I have a Hyperlink with an ImageUrl inside a templatefield of the gridview:
<ItemTemplate >
<asp:HyperLink ID="HyperLink1" runat="server" ImageUrl= '<%# Eval("path") %>' NavigateUrl = '<%#"EventDetails.aspx?id=" + DataBinder.Eval(Container.DataItem, "id").ToString()%>'
Text =" SomeText" Width="10px" Height="10px"></asp:HyperLink></ItemTemplate >
. Altough I set the Width and Height at
10 px, the image is showed at his original size. I checked the Width and
Height settings in the properties as well as in HTML. They are there and in
design mode the control box is showed at the 100 px size.
Any ideas?
Thanks
|
|
|
|
|
Try with using generic handler to reduce the image size(i am afraid to say this)
Ramkumar
|
|
|
|
|
Look at the way this renders by viewing the source:
<a id="ctl00_HyperLink1" href="http://www.bbc.co.uk" style="display:inline-block;height:10px;width:10px;">
<img src="Sunset.jpg" alt="SomeText" style="border-width:0px;" >
</a>
so you're setting the height and width of the hyperlink, not the image. I'd use css to set the height and with on the img tags.
ie:
<style type="text/css">
a img
{
height:10px;
width:10px;
}
</style>
|
|
|
|
|
Hi,
I have an asp.net page with a send button. when I hit that button, I send some information to the DataBase. When I try to refresh the page I'm asked to resend the inforamtion or to cancel the refresh. as a result, I get multiple rows in the database...
how can I refresh the page and prevent the resending of the info?
|
|
|
|
|
create one primary key in that database so that it will return eror message that duplicate column, capture that error and throw user friendly error message.......
[or]
disable refresh and f5 button....
modified on Tuesday, August 25, 2009 8:00 AM
|
|
|
|
|
I don't think it's a right solution for my problem.
I want to allow users send some duplicate info, but I dont want it to happen automatically when they refresh the page.
|
|
|
|