Response.Redirect(my site's url + "editques/" + "QuesID/" + QuesID + "/" );
Redirecting as shown above...In the editques.aspx page, whenI debug, I see the Query String's value as {QuesID=jhgjgjhjk&PID=jhhkjkj}
Where on earth did this PID came from!??
There must be some component that needs to persist a value between postbacks and is using the query string for that purpose.
Update: Are you by any chance displaying paginated data on the page? PID might stand for page id and might be generated by the component that is handling paging.
var c = new HttpValueCollection();
c.Add(HttpUtility.ParseQueryString(Request.Url.Query));
if (!string.IsNullOrEmpty(c["PID"]))
c.Remove("PID");
Are you sure you aren't redirecting before this line or after this line?
I don't even see the FAQID in that Qstring..
Related
I'm new to this and just did my first Hello World program yesterday.
I'm wondering if i can change the f5 to a varible.
Console.WriteLine("{0:f5}", theAnswer);
The 5 would change depending on the user input.
This didn't work, but is it possible to use something like it,
Console.WriteLine("{0:f + myVarible}", theAnswer);
If not, any suggestions on what route I should take would be helpful.
You could try with:
Console.WriteLine("{0}", theAnswer.ToString("f" + myVariable));
Or, if you only have the {0} in:
Console.WriteLine(theAnswer.ToString("f" + myVariable));
You can try solve this by changing your code:
Console.WriteLine("{0:f + myVarible}", theAnswer);
to this
Console.WriteLine("{0}", usersAnswer.ToString("f" + myVariable));
I have developed a small application which reads user information from Active directory.
In the beginning of the application I used the below filter
search.Filter = "(&((&(objectCategory=Person)(objectClass=User)))(displayName=*" + username + "*))";
This worked fine.
Now, I am giving the user an option to retrieve the employee details based on username OR office OR title fields.
The query I used to get the details is as follows, but not working. It throws and exception
"search filter is invalid."
(&((&(objectCategory=Person)(objectClass=User)))(|((displayName=*" + username + "*)(l = *" + location + "*)(title=*" + title + "*))))";
Example: retieve the details of employee based on location : Hyderabad
The runtime query looks like this
(&((&(objectCategory=Person)(objectClass=User)))(|((displayName=**)(l = *hyder*)(title=**)))
search filter is invalid.
I think, as your intentions are not clear, what you are looking for is something more like:
(&(objectCategory=Person)(objectClass=User)(|(displayName=sam)(l=location)(title=title)))
Which could be visualized as:
(&
(objectCategory=Person)
(objectClass=User)
(|
(displayName=*sam*)
(l=*location*)
(title=*title*)
)
)
Of course you would need to put in your code parameters instead of the values shown.
I am working on a requirement where i need to display the permissisons of a folder for all Users and Groups programatically using C#.
Here, is the code, i am using to do it:
DirectorySecurity filesecure = Directory.GetAccessControl(txtPath.Text);
StringBuilder strbldACLlist = new StringBuilder();
filesecure.GetSecurityDescriptorSddlForm(AccessControlSections.All);
foreach (FileSystemAccessRule ace in filesecure.GetAccessRules(true, true, typeof(NTAccount)))
{
strbldACLlist.Append(ace.FileSystemRights + ":" + ' ' + ace.IdentityReference.Value + "\n");
}
I am getting the output like this:
"ReadAndExecute, Synchronize: dm1\\55555\nFullControl: dm1\\343556\n268435456: dm1\\343556\nFullControl: NT AUTHORITY\\SYSTEM\n268435456: NT AUTHORITY\\SYSTEM\nFullControl: BUILTIN\\Administrators\n268435456: BUILTIN\\Administrators\n"
Here, for the first user i am getting properly the file permissions. But, if you see the second userid i.e 343556 , i am getting result two times as you can see Full Control for first time nad some number n268435456 which i do not under stand.
Can any one please analyze the output and explain what's happening actually..
Have a look here. It's saying that FileSystemAccessRights is a Flags enum (i.e. its values can be or-ed). The actual number you've got 268435456 - is a combination for which a name hasn't been supplied.
Cheers -
Sorry if this question is out of context, but I don't know where else to look and StackOverflow tends to provide the best support. I'm having a problem with FlexPaper not loading the locale for HTML rendering option. It appears to be working for Flash version with no problem, but not for the HTML viewer specifically.
Here is the config which loads the control onto a page:
var searchServiceUrl = escape(ashxDir + "containstext.ashx?doc=" + guid + "&page=[page]&searchterm=[searchterm]"),
docUrl = escape("{" + ashxDir + "view.ashx?guid=" + guid + "&numPages=" + numPages +"&format={format}&page=[*,0]," + numPages + "}"),
configObj = {
DOC: docUrl,
...
DocSizeQueryService: ashxDir + "swfsize.ashx?doc=" + guid,
jsDirectory: "/FlexPaper/js/",
JSONDataType: "jsonp",
localeDirectory: "/FlexPaper/locale/",
localeChain: "en_US"
};
This is exactly how I've found it while looking through documentation and everything else, but it simply does not work for me. I've scoured the internet and nobody else seems to have this problem. Unfortunately when I click on the print button all of my labels and buttons show 'null'. Here is a screenshot of what I get when I try to load the page in the HTML viewer:
If you notice in my configuration above, the localeDirectory is set as a sibling directory of the js directory. The locale directory has all of the valid directories under it which hold the localized strings for various languages (ie. en_US, zh_CN, etc..). I've even tried moving the locale directory around the system to see if it is expecting a different "root", but again to no avail...
Any information would be greatly appreciated.
i had that "null" problem in my PHP set up of flex paper in that i put locale & js folder in my location so it is not fetching correct path so i put correct path in default page from where $('#documentViewer').FlexPaperViewer({ defines i just put below paths :
jsDirectory:"http://{xxx}/subdirectory/assets/js/",
localeDirectory:"http://{xxx}/subdirectory/assets/locale/",
may be this will help others
We found the problem and I realize that I never updated the case with the 'Answer'. The fix was directly related to a wrong url which fed the localized strings to the dialog. We were only able to track it down by interrogating the HTTP Request using Chrome Web Tools. It wasn't a complex fix, but it proved to be a complex issue to track down and diagnose properly.
Hope this helps someone someday.
I am working with .net 4.0 c#.
I want to be able to get the url from the current http request, including any virtual directory. So for example (request and sought value):
http://www.website.com/shop/test.aspx -> http://www.website.com/shop/
http://www.website.com/test.aspx -> http://www.website.com/
http://website.com/test.aspx -> http://website.com/
How is it possible to achieve this?
This is what I use
HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpContext.Current.Request.ApplicationPath;
Request.Url should contain everything you need. At that point it's a matter of checking the string, and what you prefer to grab from it. I've used AbsoluteUri before, and it works.
This example isn't fool proof, but you should be able to figure out what you need from this:
string Uri = Request.Url.AbsoluteUri;
string Output = Uri.Substring(0, Uri.LastIndexOf('/') + 1 );
This solution could work and is shorter:
string url = (new Uri(Request.Url, ".")).OriginalString;
This should work
Request.Url.OriginalString.Substring(0, Request.Url.OriginalString.LastIndexOf(Request.FilePath.Substring(Request.FilePath.LastIndexOf("/")))) + "/"