|
hai,
try to access the web service directly without using that in a application.
if you are able to invoke the method of you web service, then you can try the same in application. if you have any problem in accessing the service do the needed thing and try to do the same in application.
if you are able to access the method directly and not by the application then check the security part of the web server where you have published it.
you can do this easily..
cheers
asithangae
|
|
|
|
|
|
Well, I think it has to do with how the login control works. You see the login control keeps track of where you currently are when you try to log in. So then the login control knows where to send you back once you have logged in. I haven't tried this, but I would suggest looking into the "DestinationPageUrl" property of the login control and think about setting the page you want to go to there instead of doing a redirect.
Hope that helps.
Ben
|
|
|
|
|
i have to make redirect becuse of security .
so s(role) user go to where s can view pages
and p(role)user go where he can see or view pages
i hope u can help me and tell me what to do?
If I HaD OnE sInglE wIsh IwIll gO back for thE fIrst tIme i sEE yOu
|
|
|
|
|
Are you using the login in control? I am pretty sure you are. There is a property on the login control called DestinationPageUrl.
So your code is:
if (User.Identity.IsAuthenticated)
{
if (User.IsInRole("Student Affairs"))
{
Response.Redirect("~/StudentAffairsFolder/home.aspx");
}
else if(User.IsInRole("Staffs"))
{
Response.Redirect("~/staffs/home.aspx");
}
}
else
Response.Redirect(
"Default.aspx");
}
I am saying your code should be:
if (User.Identity.IsAuthenticated)
{
if (User.IsInRole("Student Affairs"))
{
Login1.DestinationPageUrl = "~/StudentAffairsFolder/home.aspx";
}
else if(User.IsInRole("Staffs"))
{
Login1.DestinationPageUrl = "~/staffs/home.aspx";
}
}
else
{
Login1.DestinationPageUrl = "Default.aspx";
}
The issue is that the Response.Redirect can not overwrite what is in the DestinationPageUrl of the Login1 control.
Hope that helps.
Ben
|
|
|
|
|
Hi, I want to write a C# function to strip any HTML tag from a String -- not just the tag itself but also whatever is inside the tag... and also to handle the situation where there are nested tags.
I'm having a hard time trying to figure this out, and am hoping someone can help.
For example, lets say I have a String that contains HTML like this:
This is a test <tag>some text <tag> some more text </tag> possibly more text </tag>
and only a test. I wish to get rid of everything between the <tag> tags... kill it completely... and end up with a string like this:
This is a test and only a test. I've been trying to make a function in C# simular to this:
public static String StripTags( String OldHtml )
{
String NewHtml = "";
NewHtml = Regex.Replace( OldHtml,
SEARCH_FOR,
REPLACE_WITH,
RegexOptions.IgnoreCase | RegexOptions.Compiled );
return NewHtml;
} The problem is I'm having a really hard time trying to figure out how to create the SEARCH_FOR and REPLACE_WITH portions for the RegEx.Replace above.
Any assistance would be greatly appreciated! Thanks!
And *NO*, this is not a homework assignment. I'm trying to create a text summary of HTML that can be displayed in truncated fashion... for forum software that I'm writing... but I need to remove certain tags. Thanks!!!
|
|
|
|
|
To handle nested tags, you have to do repetitive removals.
Make a pattern that matches an html tag with it's end tag and no html tags between them, only text. Use that to remove the innermost tags in the text. Then repeat until there is no tags left.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
|
Hello..I have been taken on a project where entire website is launched as a asp.net project with vb language. When i was given ftp access, i could only find all .aspx files and only few of them had coding files on ftp site. Its compiled .dll and .pdb are present in bin. Now they want me to make some modifications to the site. But when i downloaded all the files present on ftp of that site, i found some class files missing as well there is no solution file to open up the project in visual studio project. Now is there a way that i can work on this project to make small changes to the website without a solution file and few class files missing..so that i can recompile the project and put that .dll into ftp site..hope you understood my problem..
|
|
|
|
|
this solution is applicable if the .net frame work is 2.0.
for visual studio 2005 or for asp.net 2.0 projects their is no need for a solution file, select open website from the file menu and the web application will be opened for you. one more thing if you are not having enough code behind files you cannot modify the application check that they have written inline coding for them.
just rebuild after modification and publish that in the ftp site, you have provision for that in visual studio 2005.
cheers
asithangae
|
|
|
|
|
hi All
I am working a long a project has been done with testenvironment web service.
problem with that i have used the namespace in all the pages.
like suppose.
com.wstest.serviceprover.classname1 _obj=new com.wstest.serviceprover.classname1();
com.wstest.serviceprover is the remote provider.
now i have to switch to the live environment
what will be way to do it.
Thanks in advance.
Srinandan
|
|
|
|
|
The only way I know how to fix something like that is to do a mass search and replace.
NOTE I would suggest NOT putting what environment you are in, in the namespace of your classes. It leads to bad problems like this.
Ben
|
|
|
|
|
thanks for help
is there another way to handle this situation from the web.config.
another thing when a web service is use in the new one project how should it handle by web.config so i can change the only the web service testenvironment namespace to live invironment in the web.config.
i want to set it like connection string whenever need we can change it the connectin string as the key always fix the key .
if any way to handle like this please reply asap.
thanks
srinandan..
|
|
|
|
|
I have been working on a way in asp.net 2.0 to do this. I am having a little trouble with the new Connectionstring section. I will let you know if I get it working. If you are using asp.net 1.1 there aren't a lot of options, since the configuration stuff is pretty locked down. Sorry I couldn't be more helpful.
Ben
|
|
|
|
|
Hi Kubben
Thanks for reply.
this project is developing with asp.net2.0. but trouble with earlier problem yet. i have not find any soltion other than find n replace. if you get any solution pls.
thanks
Srinandan..
|
|
|
|
|
Hey Srinandan,
I figured it out. I am going to post an article as soon as I get time to write it. Just wanted to let you know
Ben
|
|
|
|
|
thanks Ben
pls let me know when you send this article.
Regards
Srinandan
|
|
|
|
|
|
thanks Ben
i will try it. if any problem then i will contact you.
Regard
Srinandan..
|
|
|
|
|
hi friends
can we add datagrid to a placeholder control at runtime in asp.net.
regards
saravanan
|
|
|
|
|
In the Page_load event of the aspx file you can add code like:
DataGrid dg = new DataGrid();
DataTable dt = new DataTable("Test");
dt.Columns.Add("col1");
dg.DataSource = dt.DefaultView;
dg.DataBind();
plh1.Controls.Add(dg);
Assuming you want a single column with col1 in it and hour placeholder control is named plh1
Hope that helps.
Ben
|
|
|
|
|
Hi,
Can anybody has an idea of how do we make the entire row of a grid selectable ie once he moves over a row the row color should change and onclick the corresponding row should be selected and datagrid selectedindexchanged event be fired.
|
|
|
|
|
|
Please be more specific.How do i set onmouseover and onclick event to each row. How can the onclick event trigger the selectionchanged event.
|
|
|
|