|
Thanx Pilo!!
It works..
Now if u could help me with the placement of the PlaceHolder?
Thanx again. :>
Fahad
-- modified at 3:01 Thursday 3rd August, 2006
|
|
|
|
|
Lol, how is it possible that it works, if you dont have a placeholder
just place it in your .aspx file, on place where you want to have images:
<body>
<form id="form1" runat="server">
<div>
<asp:Label runat="server" id="label1" Text="Here are my personal nude pics:"/>
<asp:Placeholder runat="server" id="myPlaceholder">
</asp:Placeholder>
</div>
</form>
</body>
Placeholder is not rendered on a page, it is just what its name says: placeholder. you can use it to reference a place in your page to work with it in your code. So when you put image controls into it, it will be rendered just as a collection of images.
Pilo
|
|
|
|
|
Hi,
I placed the placeholder but i cannot drag the placeholder to the location where i require it to be. when i drag n drop the placeholder from the toolbox panel it always places itself on the left top of the screen.
How did u think that i hadnt placed a plceholder??? You thought i was being dishonest and saying that it worked. ;(
Thanx anyway again..
Fahad
|
|
|
|
|
Heh, don't take it personaly, I was joking, because in your post you wrote, that it is working, but you didn't place placeholder
You can move your placeholder using html tags, this is default behaviour in aspx designer, that you don't have a grid. Probably you can turn the grid on, but I'm not in office and I don't have VS on my laptop, so I can not tell you how. But I never use grid, it does not seem to be right way how to position placeholder.
just wrap it into <div> tag and align this div to center. if you want to move it down, use <br/>
Pilo
|
|
|
|
|
Hi,
I didnt take it personaly, but i felt i should make my side clear.
Thanx the <div> and <br> thing worked...
Thanx a lot Pilo. u were of great help.
Now if u could help me how to get the name of the checkbox that i have created in the PlaceHolder. On the CheckedChanged Event of the checkbox i want to perform some action..
|
|
|
|
|
this is a way how you should create a checkbox:
// create checkbox object
Checkbox myCheckbox = new Checkbox();
// set its ID, can be used later for FindControl(string controlId) method to
// find this control on a page
myCheckbox.ID = "myCheckbox";
// assign event handler which handles checking/uchecking checkbox
myCheckbox.CheckedChanged += new System.EventHandler(myCheckbox_CheckedChanged);
// set autopostback to true, if you want checking/unchecking to cause post back
// and call eventhandler immediately after checking/unchecking
myCheckbox.AutoPostback = true;
// add checkbox to your placeholder
myPlaceholder.Controls.Add(myCheckbox);
// event handler
protected void myCheckbox_CheckedChanged(object sender, EventArgs e)
{
// here you can see name of your checkbox
string checkboxID = ((Checkbox)sender).ID
}
I think this should be working fine, I hope this answers your question.
Pilo
|
|
|
|
|
Hi Pilo,
On the checkedchanged event i want to disable all the other checkboxes except for the one that was checked and on unchecking it all the checkboxes should be enabled.
If u could give me the solution to this problem. The code that is used for creating the checkboxes in the PlaceHolder is as follows:
image.ImageUrl = imageUrls[1];
placeHolder.Controls.Add(image);
placeHolder.Controls.Add(checkBox);
Thanx alot Pilo!!
Fahad Wali
-- modified at 2:32 Tuesday 8th August, 2006
|
|
|
|
|
You can write this code in your event handler:
protected void myCheckbox_CheckedChanged(object sender, EventArgs e)
{
string senderId = ((Checkbox)sender).ID;
bool enableOthers = !((Checkbox)sender).Checked;
foreach(System.Web.UI.Control control in placeHolder.Controls)
{
if (control.GetType().ToString() == "System.Web.UI.WebControls.Checkbox")
{
if (control.ID != senderId) control.Enabled = enableOthers;
}
}
}
I don't want to be inpertinent, but if you ask for a code allways when you have a problem, you will never be a programmer
You should try to do such a simple algorithm yourself...
Pilo
|
|
|
|
|
Hi Pilo,
Its really nice of u to think like this, but u know wat its been just about 2 months for me on asp.net. previously i used to work on java, n i had no experience of Microsoft platform. so this is all new for me n very much confussing !!
Any way im tryin to make the code u gave me work. i just started workin on it today. i hope i succeed..
thanx alot Pilo.
can i have ur hotmail id so i could talk to u more often.
Fahad Wali
|
|
|
|
|
I need to validate whether the input string contains any special characters other than alphabets and numbers.
TIA,
Sam.
|
|
|
|
|
Please don't cross post.
---
Here is an example: a function that checks if a string only contains didigts:
Javascript: Only digits[^]
-- modified at 15:09 Wednesday 2nd August, 2006
---
b { font-weight: normal; }
|
|
|
|
|
hi..
I'm a newbie in asp.net and need to work on a problem log website.Can anybody send me a sample code or a tutorial where to start?
Like how can I connect the data filled by the user to a database? How to authenticate users and so on...
THanks in advance.
|
|
|
|
|
|
there are several sites you can start from and one of them is www.asp.net
Then there are many other sites like www.csharpcorner.com
If you are using ASP.NET 1.1, then you need to make your custom authentication.
If you are using ASP.NET 2.0, then there is a built in authentication in it.
Sandeep S. Sekhon
|
|
|
|
|
Hi all, I have an issue when I try to load an activeX in a ASPNET project, when I use early binding I get an error like Query interface failed, and when I use late binding I get "cannot create activex component", I know there security stuff to check in dcomcnfg tool , and a security patch Qsomething, but none of this seems to work.
this problem is driving nuts, and I will be greatful if someone have any clue.
Thanks
bat76230 FrenchDeveloper
|
|
|
|
|
Hi there,
Are you sure that the ActiveX control is installed on the client machine when you want to create it on the web page at the client side? If not, you may need to look at the codebase attribute to point to the location where the ActiveX can get downloaded.
|
|
|
|
|
i am new to asp.net and i am using asp.net 2003 and sqlserver2000
i had problem whle uploading file into database
i had task upload file into database
plz help me , and send any code for this
prasad.g
|
|
|
|
|
If it is an image file, then you can upload it into the database. If it is any other file, then you can store the address or path of the file in the database and store the file at the location specified in the database.
You can use HTML file input control to upload file into the database.
Sandeep S. Sekhon
|
|
|
|
|
You can save any file you like into the DB, there are couple of good article on this site about file upload, if you have a search, they should answer your questions.
|
|
|
|
|
How do i display image from a database on an ASP page.
being read in a stream. which component should i use.
doing so is possible in window based application
This Is the code
SqlCommand comm = new SqlCommand("select photo from photos where name='sachin'", conn);
byte[] b = (byte[])comm.ExecuteScalar();
if (b.Length > 0)
{
// Open a stream for the image and write the bytes into it
System.IO.MemoryStream stream = new System.IO.MemoryStream(b, true);
stream.Write(b, 0, b.Length);
//if c#'s window based application then i can do it like this
//pictureBox.Image = new Bitmap(stream);
}
Sarbjeet Singh
|
|
|
|
|
I'm affraid you have to save the image to your disk and then set ImageUrl property of System.Web.UI.WebControls.Image object to url of saved image.
Pilo
|
|
|
|
|
Do i have the permission to write on clients HDD.
probably i can write in temp folder which is inside Windows or Winnt folder.
how do i get the system folder's name i mean is it windows or winnt
Thanks
|
|
|
|
|
You can not write to a folder outside an application root. Imagine if users can display files from Windows folder... no no, that's bad idea
Just create folder Images in your application root (c:\inetpub\wwwroot\MyApp usually) and set permissions to write to this folder for user IUSR_MACHINENAME, where MACHINENAME is name of your computer. This user is account IIS is running under. Then you can assign this url to your Image control: "~/Images/mySavedImage.jpg"
Should be working, if not, write down what is wrong.
Pilo
|
|
|
|
|
i am reading the image from the database.
what will happen if three four users come at the same time.
Regards
|
|
|
|
|