|
Use
string root = Server.MapPath("~");
|
|
|
|
|
mghiassi wrote: but it does not work
what the error you are getting??
|
|
|
|
|
I can't access to this address if root string
http://localhost/project/picture/aks-13
but I recive this string
E:\mgh\AmirKabir\ASP.NET\Project\Picture\aks-13
|
|
|
|
|
Error Desc.:
The Type initialize for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.
Previously I have used crystal report with VS2005 in Win XP, there is no problem but when I am using it in Win 7 then it is creating this problem. Please help me.
|
|
|
|
|
Hello everyone,
Basically my task is sorting the gridview manually and I got many solutions for that. But all of them are having the following thing in common.
DataView dv = new DataView(dt);
dv.Sort = sortExpression + direction;
But in my code, I have to bind an IList (collection or generics), and not any dataset, to my gridview. Somehow,I am not able to find the Sort property for an IList.
Could anyone please suggest what can I do about this?Do I have to convert the IList to a daraset?if yes,please tell how?
Thank You.
|
|
|
|
|
|
|
On successful login, how can I make sure the user always goes to dfault.aspx?
Thanks
|
|
|
|
|
solved by DestinationPageUrl
Thanks
|
|
|
|
|
great
***** Programme comme si dept soutien technique. est plein de tueurs en série et ils savent adresse de votre domicile. *****
|
|
|
|
|
Hi,
I need to build a ASP.net web page which can be added to any web application to show the helath of the web application.
The Items that it need to check:
1. Is the DB up and running - The DB connection string should be automatically picked from web.config
2. Any web services referenced by that applications are up and running.
3. Check for any DB jobs for that User in DB and get the last run time.
etc...
Any help in this direction is highly appreciated.
Thanking you advance,
Neha
|
|
|
|
|
|
Thanks Vipul for your response.
Actually I am more interested on the generic stuff.
The application which I am working on
1) Should query all the WebSites configured in the IIS of the system where the proposed application is deployed,
2) Read the individual web.config files of thoses applications and get the Connection Strings, Web Refrences etc.
3) Ping the DB / Web Services and show the responses.
Thanks,
Neha
|
|
|
|
|
Hi All,
if (!IsPostBack)
{
if (Session["userId"] == null || Session["SessionId"] == null)
Response.Redirect("~/Login.aspx");
else
{
BindModalities();
UserRole curRole = (UserRole)Convert.ToInt32(Session["roleId"]);
InitializeRoleView(curRole);
if (Session["SelWorklistView"] != null)
InitializeWorklistView();
else
{
if (curRole == UserRole.Admin)
{
Session["SelWorklistView"] = (Int32)Global.WorklistView.ReqPending;
InitializeWorklistView();
}
else
{
Session["SelWorklistView"] = (Int32)Global.WorklistView.Pending;
InitializeWorklistView();
}
}
}
}
and in Row Data Bound Event
This will add silverlight button in a grid.
protected void worklistGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
RisStudyItem selStudy = e.Row.DataItem as RisStudyItem;
string idealHost = selStudy.Server.HostLocal;
string tempStr = idealHost.Substring(0, idealHost.LastIndexOf('.') + 1);
if (idealHost == null || idealHost == "" || tempStr == null || tempStr == "" || !Request.UserHostAddress.StartsWith(tempStr))
idealHost = selStudy.Server.HostExt;
HtmlGenericControl obj = new HtmlGenericControl("object");
obj.Attributes["data"] = "data:application/x-silverlight-2,";
obj.Attributes["type"] = "application/x-silverlight-2";
obj.Attributes["height"] = "30px";
obj.Attributes["width"] = "130px";
HtmlGenericControl par1 = new HtmlGenericControl("param");
par1.Attributes["name"] = "source";
par1.Attributes["value"] = "../ClientBin/Moksha.Ris.Silverlight.xap";
obj.Controls.Add(par1);
HtmlGenericControl par2 = new HtmlGenericControl("param");
par2.Attributes["name"] = "onError";
par2.Attributes["value"] = "onSilverlightError";
obj.Controls.Add(par2);
HtmlGenericControl par3 = new HtmlGenericControl("param");
par3.Attributes["name"] = "background";
par3.Attributes["value"] = "white";
obj.Controls.Add(par3);
HtmlGenericControl par4 = new HtmlGenericControl("param");
par4.Attributes["name"] = "minRuntimeVersion";
par4.Attributes["value"] = "3.0.40624.0";
obj.Controls.Add(par4);
HtmlGenericControl par5 = new HtmlGenericControl("param");
par5.Attributes["name"] = "autoUpgrade";
par5.Attributes["value"] = "true";
obj.Controls.Add(par5);
HtmlGenericControl par6 = new HtmlGenericControl("param");
par6.Attributes["name"] = "initParams";
par6.Attributes["value"] = "suid=" + selStudy.StudyInstanceUID +
",studyInsts=" + selStudy.NumberOfStudyRelatedInstances +
",idealHost=" + idealHost +
",studyDate=" + selStudy.StudyDate +
",username=" + selStudy.Server.Username +
",password=" + selStudy.Server.Password;
obj.Controls.Add(par6);
e.Row.Cells[14].Controls.Add(obj);
}
}
I have a Radio button in Grid so when i m selecting silverlight control so i need to all thing again.
Thanks and regards,
Amit Patel
|
|
|
|
|
|
how to give acess to different users for different pages (ie when user login based on his permissions he should be able to access his pages) usin asp.net with c#
|
|
|
|
|
You could use an atrribute to check the status of the user and redirect accordingly.
Here is some simplistic pseudo code:
[AttributeUsage(AttributeTargets.All)]
public sealed class UserStatus : Attribute
{
public UserStatus()
{
if (!UserShouldBeHere)
{
HttpContext.Current.Response.Redirect("SomewhereElse.aspx");
}
}
}
At the top of each page you want to check this on decorate the class with:
[UserStatus]
public partial class MyAccount : Page
... code continues
|
|
|
|
|
|
Thanks, but I know what I meant. You should add this as a separate answer as it is equally as valid and should be able to be marked on it's own. (Not everyone uses principals, roles, etc, to model security).
|
|
|
|
|
Sorry some mistake was there i did not want to post the message to you..
Thanks.
|
|
|
|
|
the code which you have send where we have to write the code.and can you give small example for this...
|
|
|
|
|
Put this below attribute in the top of your Page Code behind and Name Parameter is the permitted user for this page....
[PrincipalPermission(SecurityAction.Demand,Name=@"kovairindia\palash",Unrestricted=false)]
Thanks
|
|
|
|
|
Use..
[PrincipalPermission(SecurityAction.Demand,Name=@"kovairindia\palash",Unrestricted=false)]
public partial class Test : System.Web.UI.Page
Only the user palash of domain Kovairindia will access this page. If Other one say rahul of Kovairindia domain will get System.Security.SecurityException exception.
N.B:You can also give a permission to a Role for your page.
|
|
|
|
|
Hi Guys,
Scenario:
i've finished an ASP.NET app. The users log on via a secure network anywhere in the world. When they've registered, they download a win app on their systems used to encrypt files. They select the files they want to encrypt, but don't knw the output path (for security reasons). When they log on, they should just click a button and all those encrypted files (from the output location) should be uploaded to the server.
Problem:
However, I do not knw how to automatically start the upload as I don't want them to manually pick the files (they don't even knw where the files are, but i do). Pls help. Deadline close.
He who goes for revenge must first dig two graves.
|
|
|
|
|
If you are having them run a Windows app then you have complete control over this. After the files have been encrypted push them to the location of your choice. What part are you stuck with?
I know the language. I've read a book. - _Madmatt
|
|
|
|