|
hey,
isn't it something like
Server.MapPath("hint\\"+fleUpload.FileName)
suchita
|
|
|
|
|
something like this
Image1.ImageUrl=Server.MapPath("images/yourimage.jpg");
Server.MapPath return root path.
when your project on web, the image path of your image controls shows like <img src="images/yourimage.jpg"/>
|
|
|
|
|
so that means it doesn't matter where ever i put my project right. it will automatically take the server path so that i do not need to change the path again and again right.
suchita
|
|
|
|
|
SayamiSuchi wrote: so that means it doesn't matter where ever i put my project right. it will automatically take the server path so that i do not need to change the path again and again right.
yes no need to worry
|
|
|
|
|
|
SayamiSuchi wrote: thanks
welcome, but don't forget to rate if it help you.
|
|
|
|
|
Hey,
Well i did
fleUpload.SaveAs(Server.MapPath("hint\\" + fleUpload.FileName)); to save the image and it worked perfectly fine.
But I am trying to show the image from that server and for that i did
Image1.ImageUrl = (Server.MapPath("hint\\" + fleUpload.FileName));
The problem is it is not throwing any error but it is not showing the image in the Image1 either. What can be the reason for this and how to get the image ?
suchita
|
|
|
|
|
try this
string savepath=Server.MapPath("hint\\"+fleUpload.FileName);
fleUpload.SaveAs(savepath);
Image1.ImageUrl=savepath;
|
|
|
|
|
hi guys
i want a pretty good asp.net mailserver open source
give me a clue
|
|
|
|
|
Poor question: we are not here to provide you with complete solutions. Try searching here for info then try Google.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
|
|
i create dynamic checkboxes in coloum of table(<td id="trial" runat="server"></td>) from selecting quantity from dropdwonlist.
well creating dynmic checkbox is not an issue..
well the issue is tht i am not able to check whether the Checkboxes is checked or not on a Button click....
the functiion used for generating dyamic checkbox..
protected void ddlList_SelectedIndexChanged(object sender, EventArgs e) <br />
{<br />
int no=convert.toint32(ddlist.selectedvalue); <br />
<br />
<br />
for(int i=1;i=<no;i++)<br />
{<br />
checkbox ch=new checkbox()<br />
ch.ID="chk_t"+i;<br />
ch.text="trl"<br />
<br />
trial.controls.add(ch);<br />
<br />
}<br />
}
the function where i check whether checkboxes is checked
protected void btnSave_Click(object sender, EventArgs e) <br />
{ <br />
list<string> status_tn=new list<string>();<br />
<br />
for (int j = 1; j <= no; j++)<br />
{<br />
trialid = "chk_t" + j;<br />
<br />
<br />
CheckBox checks=(CheckBox)trial.FindControl(trialid);<br />
<br />
<br />
<br />
<br />
if (checks.Checked)<br />
{<br />
<br />
status_tn.Add("Trial");<br />
<br />
<br />
}<br />
}<br />
}
in this function i get error :
:System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="App_Web_pm_-zh7o"
StackTrace:
at btn_save_Click(Object sender, EventArgs e) in d:\Dot Net App\Talents\types_seeb.aspx.cs:line 325
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
|
|
|
|
|
i realize when page get posts check box not generating dynamically
so try to re generate the dynamic check boxes in your save click, sorry if i am wrong
protected void btnSave_Click(object sender, EventArgs e)
{
ddlList_SelectedIndexChanged(sender,e)
}
|
|
|
|
|
mobins wrote:
CheckBox checks=(CheckBox)trial.FindControl(trialid);
if (checks.Checked)
{
status_tn.Add("Trial");
}
//to solve error
CheckBox checks=(CheckBox)trial.FindControl(trialid);
if(checks!=null)
{
if (checks.Checked)
{
status_tn.Add("Trial");
}
}
|
|
|
|
|
Hi,
Before Checking the status of check boxes whether they are checked or not, Please Confirm that control is exists or not. And also confirm that the dynamical checkboxes generation code is not executed on button click event.
I hope u understand it ...
Rajendra Prasad Panchati
.Net/Sharepoint Software Enginner
hyderabad.
|
|
|
|
|
When i work width tab ajax control, and in one tab, I have a Repeater:
<asp:Repeater runat="server" ID="rp1" onitemcommand="rp1_ItemCommand">
and in protected void rp1_ItemCommand(object source, RepeaterCommandEventArgs e) method, i add a button and it's event:
Button btn = new Button();<br />
btn.Text = "Update";<br />
btn.Click += new EventHandler(btn_Click);<br />
((Repeater)source).Items[0].Controls.Add(btn);<br />
void btn_Click(object sender, EventArgs e)<br />
{<br />
Response.Redirect("http://google.com");<br />
}<br />
but when click on update button, event do not raise(btn do not drive click event).
please help me !
Sorry for my english.
|
|
|
|
|
It seems that you do not give your button object an ID, so it cannot decide which button to use. Maybe try that and see if the result is better? Good luck.
"My personality is not represented by my hometown."
|
|
|
|
|
btn.ID = "Cmd3";
Thank. I did it, but not work.
|
|
|
|
|
Does your code work when you place the repeater outside of the AJAX control?
"My personality is not represented by my hometown."
|
|
|
|
|
Same, it not work. Please give me a solution
|
|
|
|
|
when i use PlaceHolder instead of Repeater, the problem continue
|
|
|
|
|
I did it, but not work
Thank !
|
|
|
|
|
Please run your page in debug mode, and set a breakpoint at the rp1_ItemCommand method. Then you can see what is causing this problem.
"My personality is not represented by my hometown."
|
|
|
|
|
Properties of btn: OnClientClick "" string
PostBackUrl "" string
UseSubmitBehavior true bool
Why OnClientClick "" string
|
|
|
|