|
Tried that - complains that there was no <HTML> tag.. ?
Regards,
Rob Philpott.
|
|
|
|
|
Who complains?
---
b { font-weight: normal; }
|
|
|
|
|
I have this code to get an image from a database and just shoot out the binary so I can use images from a database in a datagrid with template column and asp:images. So I can put "~/GetPic.aspx?id=X" in the ImageURL attribute of the asp image. Hope it helps.
<br />
int id = Convert.ToInt32(Request.QueryString["id"]);<br />
<br />
Advertisement ad = new Advertisement(id);<br />
<br />
Response.ClearContent();<br />
Response.ContentType = "image/jpeg";<br />
Response.OutputStream.Write(ad.Image, 0, ad.Image.Length);<br />
Response.End();<br />
<br />
|
|
|
|
|
Perfect! Thank you. It's ages since I've done any ASP.NET stuff, and the line I was looking for was simply:
Response.End();
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
I am doing a project in ASP.NET. I need to give the user to upload the documents through the website. While uploading the document, I would like to show the progress bar to show the status of the upload process. How can I do this?
With Regards,
Sheshadrinath.R
|
|
|
|
|
|
Hi there.
I have a GridView and a FormView. The FormView ObjectDataSource is listening to the Grid´s selected ID to display the detailed Data.
It is not visible before I select anything from die Grid.
What I would like to do is to show the FormView in Insert Mode, if there is no data in the Grid or no data has been selected yet. At the same time I´d like to display a message in the Grid if there is no data to display.
It would be nice, if someone could point me in the right direction
Thanks in advance,
Brokit
|
|
|
|
|
+ To display something when the datasource of the GridView control is empty you can use the EmptyDataText/EmptyDataTemplate properties of the control, you can read more about these in MSDN.
+ Also to change the default mode of the FormView to Insert, you simply check the datasource length, if you use the DataSource control with the GridView control you can do a checking on the select result in the Selected event, then change the mode of the FormView with the DefaultMode property or the ChangeMode method.
|
|
|
|
|
Hi
Urgent...How to place images on runtime? i do not know the number of images that will be placed on the page?
|
|
|
|
|
Create <asp:Placeholder id="myPlaceHolder" runat=server">
and then in code you can do following
using Image = System.Web.UI.WebControls.Image;
for(int i=0; i < imageUrls.Count; i++)
{
Image myImage = new Image();
myImage.ImageUrl = imageUrls[i];
myPlaceholder.Controls.Add(myImage);
}
I didn't try it, but it should works
Pilo
|
|
|
|
|
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
|
|
|
|