|
N a v a n e e t h wrote: Yes it's the correct approach, as the user of the custom control don't know you are using two controls internally.
these two controls (Dropdownlist and button) are visible to the user in the control.
|
|
|
|
|
blumenhause wrote: are visible to the user in the control.
Okay. But it is a single control right ? So I guess disabling it should disable both controls.
|
|
|
|
|
I tried this code:
public override bool Enabled
{
get
{return base.Enabled;}
set
{
btnClick.Enabled=value;
ddList.Enabled=value;
}
}
But from designer I cannot change Enabled property to false, it stays as True. However, I can set Enabled property to false in aspx page.
|
|
|
|
|
blumenhause wrote: But from designer I cannot change Enabled property to false, it stays as True
Because base.Enabled returns true and in set method you are not making this as disabled. How about the following code ?
public override bool Enabled
{
get
{
return btnClick.Enabled;
}
set
{
btnClick.Enabled=value;
ddList.Enabled=value;
}
} In get you can return any controls enabled value. Because in set method you are changing both control properties.
|
|
|
|
|
I tried this, but the Property "Enabled" is not displayed in PropertyDescriptor. I've tried the code you have provided.
|
|
|
|
|
I have a form which consist of text box. I want to allow to type only numeric value on it by using key press event how can i do this. The Text box is a standard control.
|
|
|
|
|
you have to create a javascript function in that function u have check the isNaN property if true then call this function in onkeypress event
|
|
|
|
|
HI, i am not getting how to put site map path control in webpages.
I created web.sitemap file .
<sitemap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<sitemapnode url="http://w3schools.com" title="w3schools" description="">
<sitemapnode url="http://www.microsoft.com" title="Nicrosoft" description="">
<sitemapnode url="http://www.techgene.com" title="techgene" description="">
<sitemapnode url="http://www.oracle.com" title="oracle" description="">
I added new page to project and just drag the sitemappath in the page
<asp:sitemappath id="SiteMapPath1" runat="server">
From here i am not getting. what to do next?
i want the format as follows
Home >> Test >> page
Thanks in advance
G. Satish
|
|
|
|
|
In sitemap path XML file, you should specify the page URLs.
|
|
|
|
|
I saved an image using file upload control into a database with datatype image by converting it into byte type.How i reteive it as the original image and display it into an asp image control with property ImageUrl.Plz help me by sending some code for it.
|
|
|
|
|
int length = FileUpload1.PostedFile.ContentLength;
byte[] pic = new byte[length];
FileUpload1.PostedFile.InputStream.Read(pic, 0, length);
SqlConnection con = new SqlConnection("connecstr");
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "spa";//stored procedure
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@a", pic);
cmd.Connection = con;
cmd.ExecuteNonQuery();
cmd = new SqlCommand("select * from a", con);
byte[] pic1 = (byte[])cmd.ExecuteScalar();
MemoryStream ms = new MemoryStream();
ms.Write(pic1, 0, pic1.Length);
Bitmap bmp = new Bitmap(pic1);
bmp.Save(Response.OutputStream, ImageFormat.Gif);
con.Close();
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
This is for conversion only.After converting the byte i want to display it into an asp image controlproperty of imageurl.
|
|
|
|
|
the code i delivered , will save the file to ur hard disk, now create an another aspx page and there display the image (he image which u created ), afterwards , give the link of that page in ur image control url property
Hope this will work
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Thanks For Ur Relpy
Actually i want to display the image in the same page itself on the same control.Because the actual functionality is when i select a row in a grid the grid row details will be diaplyed on the controls allowed.So i want to display the image in the image control itself.So plz gave the code for that.
|
|
|
|
|
byte[] im = (byte[])insunit.GetLogo(id);
MemoryStream ms = new MemoryStream();
ms.Write(im, 0, im.Length);
Bitmap bm = new Bitmap(im);
bm.Save(Response.OutputStream, ImageFormat.Jpeg);
//Img_Logo.ImageUrl=;
public byte[] GetLogo(string Id)
{
byte[] s;
string sqlstatement = "SELECT UnitLogoPath FROM Units WHERE UnitId='" + Id + "'";
s = (byte[])dbtObj.GetColumnValue(sqlstatement, "UnitLogoPath");
return s;
}
This is the code given when binding a grid.That means whn selecting a row the details of the row will display.What cahnge i want to gave to display the image in the Img_Loge.ImageUrl.
|
|
|
|
|
Display the image in another aspx page and and url will become that page.
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
I told u madam i want to display the image not in anotehr page but in the same page itself....i attach the code also to u people.So plz help me by go through the code.
|
|
|
|
|
Abay Dhakan , In order to make the image appear into the image control , it is mandatory to display it in a blank aspx page and afterwards give the imageurl , the address of that page(where u have to display the image).
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Wow - this is so wrong. If he saves the file to disc, he can put an image control anywhere he likes. Not saving it to disc is his core question.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The only way to do this, is to write an HTTP handler for a custom extension, which loads your image and feeds the bytes back. Otherwise, the image needs to be a file on your hard drive, not just a byte stream.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How it done please help...
|
|
|
|
|
can any one help me how to create pdf from database content using iTextSharp dll
|
|
|
|
|
Hi All,
I am using label and Button in templatecolumn of datagrid by checking some conditions,if Label is display, I want to disable the editcommand column buttons for the corresponding rows.
How Can i do this,Plz help me
Thank& Regards
Vijay s
|
|
|
|
|
I have two type User, customers and admins. there is two different table.with "Forms Authentication", I must declare (for example) :
<configuration>
<system.web>;
<authentication mode="Forms">
<forms>
name=".MyCookie"
loginUrl="/login/mylogin.aspx"
protection="All"
timeout="80"
path="/"/>
after login when I call this code : FormsAuthentication.RedirectFromLoginPage(UseName,false);
How can I detect Admin from Customer?
How Can I have two login page and how can I use "Forms Authentication" in this way. (my customers and Dmins have roles)
|
|
|
|
|
Your design is broken. You should have one table, of all people who can possibly log in. Then your site should support roles, and only show options to a logged in user who has permission to see them.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|