|
set the mode of update panel to conditional.
so that entire page can not refreshed. that may solve your problem.
Regards
Keyur Satyadev
|
|
|
|
|
Hi all
i stored image path into database and retrive that image path from it and also the picture from there location and display to Grdview control .
iam reffering following link
http://www.codeproject.com/KB/aspnet/GridImage.aspx?msg=2937267#xx2937267xx
Here is my code
int intResult = 0;
string strPath = Server.MapPath(ConfigurationManager.AppSettings["FolderPath"])+"\\"+ FileUpload1.FileName;
SqlConnection con = new SqlConnection("Server=localhost; Database= Employee; uid=sa;pwd=server");
SqlCommand com = new SqlCommand("Insert into ImageStorage(User_Name,Country,Profile_picture)values(@User_Name,@Country,@Profile_picture)", con);
com.Parameters.AddWithValue("@User_Name", TextBox1.Text);
com.Parameters.AddWithValue("@Country", TextBox2.Text);
com.Parameters.AddWithValue("@Profile_picture",strPath);
con.Open();
intResult = Convert.ToInt32(com.ExecuteNonQuery());
if (intResult != 0)
{
FileUpload1.PostedFile.SaveAs(strPath);
Response.Write("Record Inserted.");
}
and in web.config
<appSettings><add key="FolderPath" value="~/images/" /></appSettings>
so sugggest me how i store Path as absolute like ~/Image1.jpg? using above code Path is storing like below
D:\TestingMaterial\images\\button7.jpg
How i store the relative path?
Best Reagrds
Rameez
|
|
|
|
|
Hi i am using a flexgrid . But unable to change the color of single column in it.Which property should i use.
|
|
|
|
|
Hi,
I an getting this error at runtime:
"Object reference not set to an instance of an object."
And the Stack Trace:
"[NullReferenceException: Object reference not set to an instance of an object.]
AjaxControlToolkit.CascadingDropDown.CascadingDropDown_ClientStateValuesLoaded(Object sender, EventArgs e) +98
AjaxControlToolkit.ExtenderControlBase.LoadClientStateValues() +240
AjaxControlToolkit.ExtenderControlBase.Page_PreLoad(Object sender, EventArgs e) +5
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnPreLoad(EventArgs e) +75
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3368
All help aprreciated,
Thanks
|
|
|
|
|
check you have to create the object first. somewhere u missing the
creating the object. send me the code
Regards
Keyur Satyadev
|
|
|
|
|
how to use email facility in asp.net
|
|
|
|
|
|
Hi ,
You can Reffer following articles for sending emails
http://www.aspsnippets.com/post/2009/02/01/Send-Email-using-CSharp.aspx
http://www.aspsnippets.com/post/2009/01/18/Send-Email-using-VBNet.aspx
Best Regards
|
|
|
|
|
see the code and implement.
SmtpClient sendMail = new SmtpClient();
string mFrom = txtfrom.Text;
string mTo = txtTo.Text;
string mSubject = txtSubject.Text;
string mBody = txtMsg.Text;
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(mFrom, mTo, mSubject, mBody);
Attachment attach = new Attachment(fileAttach.PostedFile.FileName);
msg.Attachments.Add(attach);
sendMail.Host = "mail.ncodetechnologies.com";
sendMail.Send(msg);
lblMsgSent.Visible = true;
lblMsgSent.Text = "Message Sent";
Regards
Keyur Satyadev
|
|
|
|
|
when i was trying to move from loginpage to some another aspx page like adminindex.aspx page it is redirecting to the same login page. i used response.redirect as well as server.transfer in login button click event of loginpage
modified on Saturday, February 28, 2009 3:26 AM
|
|
|
|
|
aratireddy wrote: when i was trying to move from loginpage to some another page it is redirecting to the same login page i used response.redirect as well as server.transfer in login button click event of loginpage
In which page are your trying to redirect? Can you please put the line of code.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hai ,
I am using checkboxes in a header templates and some checkboxes in item templates,if chkHeader is checked then all the chkitem are checked.code behind is used for this, these check boxes and one btndelete button is used for deletion,i want two javascript alert
for this delete button,delete button is outside of the grid , if any check box is not selected then i want to dispaly th e java scrip alert "please choose an item" otherwise i f any one checkbox is checked and click the delete button then i want to display "are u want to delete this item",please help me(asp.net, c#,ajax,javascript)
|
|
|
|
|
I think you are looking for something like This[^]
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hai sir,
I am using checkboxes in a header templates and some checkboxes in item templates,if chkHeader is checked then all the chkitem are checked.code behind is used for this, these check boxes and one btndelete button is used for deletion,i want two javascript alert
for this delete button,delete button is outside of the grid , if any check box is selected then i want to dispaly th e java scrip alert "please choose an item" otherwise i f any one checkbox is checked and click the delete button then i want to display "are u want to delete this item" ,I cannot get the proper clientId for checkboxes,please help me(asp.net, c#,ajax,javascript)
|
|
|
|
|
You need to wire up the javascript call on the server side. You will only really be able to get the client ID on the server, where all that information is readily available. Something like the following:
void Page_Load(...)
{
chkMyCheckBox.Attributes.Add("onclick", "jsVerify('" + chkMyCheckBox.ClientID + "')");
}
|
|
|
|
|
hii,i have a slideShowExtender control in my project i want to get the images in the slideShowExtender as soon as i click the folder(which is in my local) plzz help me out
|
|
|
|
|
could somebody explain to me why on earth you would use a listview control (or almost any other asp:xxx control) on a web page?? i looked at using it just now and am frankly astounded at how much garbage there is just to draw a table on a page??? what on earth does it do that i'm not seeing??
genuinely could somebody please explain?
thnx
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Basically you may use ASP controls to render content dynamically.
In a few simple words, suppose you want to render a table with data from a DB. You cannot use a static HTML table with X rows, because you don't know how many rows you have in DB to display.
Simple options here are: to use <asp:table xmlns:asp="#unknown"> control, which can be dynamically rendered, you may add rows, columns, etc..using code behind(C#, VB), or, second option, to render HTML tags dynamically, but in this case you don't have managed support (let's say for each row from DB you'll add a < tr > tag).
Calin
|
|
|
|
|
ok i get that ... let me point out that i have been writing (and teaching) db driven websites for 6+yrs in python and php so i know exactly how to render dynamic content to html or xhtml
my question was meant to be more like ... what does the asp:listview give me (apart from a whole bunch of overhead) that rendering clean html directly doesn't?
thnx
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
ok, then.
It gives you a lot of features like: dynamic rendering, binding, custom templates, insert/edit/update modes, integrated pagination, integrated sorting...
Calin
|
|
|
|
|
but with a huge overhead and complexity that depends on a 3rd party (in this case MS) getting it all working correctly and rendering properly
when it's very easy to do all those things without all the extra layers and overhead
that was why i was wondering what asp:xxx controls bring to the party and who they are aimed at?
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
I think you might get on better with the ASP.NET MVC framework - It's a lot cleaner.
|
|
|
|
|
ahhhhh cool ... i'll take a look at that
thnx
[edit]
wow that looks cool ... url rewriting is built in
[/edit]
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
modified on Saturday, February 28, 2009 7:20 AM
|
|
|
|
|
Oops I accidentally clicked on "bad question". sorry!
//I couldn't revoke. but made it a good question.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
WinForms controls are designed for people who don't know, and don't want to know, anything about HTML. The same people who managed to write Windows apps for years without ever knowing anything about Win32. They are, IMHO, worse than useless if you actually need or want some control over what's actually sent to the client.
As Colin suggests, you'll probably be much happier with the MVC stuff.
|
|
|
|