|
Any luck.. Pls mail me if you have any articles.. Thanks..
|
|
|
|
|
|
Hi there,
i have a function which store value of document path, in my web application i have two path for example
1. path one domainname\jp\xyz
2. path two domainname\sg\xyz
the application able to get the location path of number 2 and it function is use to delete that path folder. when the user from the jp domain try the function thro error the document path cannot found?
how can i assist the string a dynamic value? since it taken value from web config
<add key="SG_PostFolder" value="D:\DMStest\Post\">
<add key="JP_PostFolder" value="D:\DMSTest\Post\">
This is the function
public string GetPostLocation(string strDocumentNumber)
{
int intTypeLength =0 ;
string strPostLocation = string.Empty;
try
{
if(strDocumentNumber.Trim().Length == 16)
intTypeLength =1;
else if(strDocumentNumber.Trim().Length == 17)
intTypeLength = 2;
strPostLocation = _postFolder;
}
catch(Exception ex)
{
throw ex;
}
return strPostLocation;
}
any suggestion please
regards
Ybasha
|
|
|
|
|
Only suggestion that i can give try to debugg your application as i am not getting your requirements so debugg t and see what the parameter value is ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hi sandeep,
Thanks for ur suggestion i already debug and when i use the application for sg domain name the function show me the file in <add key="SG_PostFolder" value="D:\DMStest\Post\"> and it delete the document nos which i pass where as when i use the function from jp domain it thro error the document nos is not found.
i think when am using the jp domain it still read the value from <add key="SG_PostFolder" value="D:\DMStest\Post\"> where is suppose to read the path from <add key="JP_PostFolder" value="D:\DMStest\Post\">
my question is how to assign the dynamic value to a string? hope this is clear.
regards
ybasha
|
|
|
|
|
try to use Server.MapPath("jp/"); relative path don;t give domain name
Might be your file structure is not proper or missing something
Sorry but i am really confused of domain ..
but
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi friends,
I am using MS.NET 2005.
In my web application i open a child window ,after clicking the submit button in child window i need to close the child window and perform one JS function in the parent window.
is it possible??
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Yes but the thing is that instead of puting javascript function in page put that in one js file and call that function after unload event of child window what you think
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
thank u
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Hi,
I have a doubt in my coding how can i achieve this
"
How to display modal popup dialog only if some statement is TRUE ?(means without the help of a button click or something like tht)
"
please anybody help me...
regards
alex.
|
|
|
|
|
How will you be changing the state of your condition?
|
|
|
|
|
hai,
i want to show an alert message or something when my control goes to catch block in the try catch...
please help me..
alex.
|
|
|
|
|
Register your javascript if that statement is true at server
i.e in page load
if(check the condition)
ClientScript.RegisterStartupScript(this.GetType(), "AnyKey", "alert('dont do this ?');", true);
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hai,
Thanks for your reply...
But my case is that i want to show that error message in catch block...in the try catch..
if something is happened in catch block i want to show a alert message....
The above code is not working ..in my case..
please help me...
alex.
|
|
|
|
|
No doubt it should work see
this
try<br />
{<br />
FileInfo fi = new FileInfo("");<br />
fi.MoveTo("sandeep.txt");<br />
if (fi.Name == "sometx")<br />
{ <br />
}<br />
}<br />
catch(Exception ex)<br />
{ <br />
ClientScript.RegisterStartupScript(this.GetType(), "AnyKey23", "alert('Frist time dont do this ?');", true);<br />
}
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
Once gain thx,,,,
but i am using asp.net ajax ....all my controls are place in asp.updatepanel...
what i give is
catch (Exception ex)
{
ClientScript.RegisterStartupScript(this.GetType(), "AnyKey", "alert('dont do this ?');");
//Response.Write("mg='kkk'");
//(this.Master as View_pages_MasterPage).SetError("hihihji");
}
but it's not working...
help me..
alex.
|
|
|
|
|
see source file of your page and check the alert script is present or not ?
What the problem are you facing ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hai,
The only problem is that alert is not coming the control is go through the code in catch and executing the script code also but alert is not coming....
alex.
my code block is give below....
protected void ChangeStatus(object sender, EventArgs e)
{
try
{
DamageReportHistory damageReportHistory = new DamageReportHistory();
DamageReportHistoryBO damageReportHistoryBO = new DamageReportHistoryBO();
DamageReportBO damageBO = new DamageReportBO();
DamageReportStatus damageReportStatus = new DamageReportStatus();
// we need the damage report again (because the hibernate session was ended at this point)
//DamageReport = (DamageReport)damageBO.GetObjectByID(Id);
DamageReport = new DamageReport();
DamageReport.DamageOldStatus = DamageReport.DamageStatus;
DamageReport.DamageStatus = drpStatus.SelectedItem.Text;
User user = CommonFunctions.GetCurrentUser();
damageBO.UpdateStatus(DamageReport, user);
//The section below is for updating damage report history table.
damageReportHistory.HistoryDetails = DamageReport.Description;
damageReportHistory.CreatedDate = DateTime.Now;
damageReportHistory.Comments = txtComments.Text;
damageReportHistory.HistoryXML = DamageReport.DamageReportXML;
damageReportHistory.CreatedUser = CommonFunctions.GetCurrentUser().UserName;
damageReportHistory.RelatedDamageReport = DamageReport;
damageReportStatus.Id = int.Parse(drpStatus.SelectedValue.ToString());
damageReportHistory.CurrentStatus = damageReportStatus;
damageReportHistoryBO.Save(damageReportHistory);
//Response.Redirect("DamageReportOverview.aspx");
}
catch (Exception ex)
{
ClientScript.RegisterStartupScript(this.GetType(), "AnyKey", "alert('dont do this ?');",true);
//Response.Write("mg='kkk'");
//(this.Master as View_pages_MasterPage).SetError("hihihji");
}
}
hoep you understand my problem again i remember you my controls are placed in
<asp:updatepanel id="UpdatePanel1" runat="server">
alex.
|
|
|
|
|
Malayil alex wrote: ClientScript.RegisterStartupScript(this.GetType(), "AnyKey", "alert('dont do this ?');",true);
here is the problem don't pass fourth bool parameter if you are saying passing script tag in third parameter
try this
ClientScript.RegisterStartupScript(this.GetType(), "AnyKey", "alert('dont do this ?');");
or
ClientScript.RegisterStartupScript(this.GetType(), "AnyKey", "alert('dont do this ?');",true);
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
I tried both...no alert is coming...
alex.
|
|
|
|
|
try this code in catch block
Response.Write("<script>alert('dont do this');</script>");
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
hai,
That also i tried ,,but no way..
alex.
|
|
|
|
|
have you tried in catch block?
check out it in page load event and tell me.
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Hi,
Yes it's work when i put in page load ,but once i give that code in the catch block some system alert error messages are coming ..
alex.
|
|
|
|
|
System Error Message?
---------------------------------------------------
|
|
|
|