|
You can use .Net Menu Control in master page same as any other page.
Could you please specify what problem you are facing in doing so?
|
|
|
|
|
|
|
I have function where I get name of the manufacturer in datatable.These manufacturer name comes as link in my usercontrol list.When I click it, it get passed in querystring for search result.
Example:
http://xyz.com/productlist.aspx?Section=Terminals&Manufacturer=Lenovo pc
but in list I have Lenovo pc & NetStation
My request is passes as
<% If Manufacturer = "" Then%>
<h2 class="subheading">
Manufacturers</h2>
<ul>
<% While Manufacturers.Read()
'Response.Write("<li><a href='/ProductList/" & Section & "/" & Manufacturers(0) & "/" & MinPrice & "/" & MaxPrice & "/" & Search & "'>" & Manufacturers(0) & "</a>(" & Manufacturers(1) & ")</li>")
Response.Write("<li><a href='/productlist.aspx?Section=" & Section & "&Manufacturer=" & Manufacturers(0) & "&MinPrice=" & MinPrice & "&MaxPrice=" & MaxPrice & "&Search=" & Search & "'>" & Manufacturers(0) & "</a>(" & Manufacturers(1) & ")</li>")
End While%>
</ul>
<% Else%>
<h2 class="subheading">
Manufacturers</h2>
<ul>
<%--<% Response.Write("<li><a href='/ProductList/" & Section & "/NULL/" & MinPrice & "/" & MaxPrice & "/" & Search & "'>" & Manufacturer & "- Remove Selection</a></li>")
%>--%>
<% Response.Write("<li><a href='/productlist.aspx?Section=" & Section & "&MinPrice=" & MinPrice & "&MaxPrice=" & MaxPrice & "&Search=" & Search & "'>" & Manufacturer & "- Remove Selection</a></li>")
%>
</ul>
<%End If%>
in above url I want
http://xyz.com/productlist.aspx?Section=Terminals&Manufacturer=Lenovo pc & NetStaions
|
|
|
|
|
For passing any special character through QueryString, It is safe to use HttpUtility.UrlEncode()
Following example will serve your purpose:
string query = "City=" + HttpUtility.UrlEncode(txtCity.Text);
query += "&Hotel=" + HttpUtility.UrlEncode(txtHotel.Text);
Response.Redirect("page1.aspx?" + query)
Hope this will help.
|
|
|
|
|
Sorry ! I haven't seen your post before reply .
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
You can encode the url before sending using urlencode and do the reverse while receiving.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi everybody,
I've a web service which has following classes:
NOTE: Some code, i.e. local variables etc, is removed for brevity.
[Serializable]
public class ResponseCode
{
public string ErrorCode
{
return _errorCode;
}
public string ErrorDescription
{
get { return _errDescription; }
}
}
[Serializable]
public class BaseResponse
{
public ResponseCode Result
{
get { return _respCode; }
set { _respCode = value; }
}
}
public class AuthenticationResponse : BaseResponse
{
public int Credit
{
get { return _credit; }
set { _credit = value; }
}
public int UserID
{
get { return _userID; }
set { _userID = value; }
}
}
Now there is the web method, which performs the authentication and returns the AuthenticationResponse object as following:
On successfull authentication:
User ID: xxxx where xxxx is number
Credit: xxxx where xxxx is number
ErrorCode: 0 (zero means no any error)
ErrorDescription: OK
On failure:
User ID: 0 (zero)
Credit: 0 (zero)
ErrorCode: xxxx (different number for different reasons)
ErrorDescription: xxxx (different text for different reasons)
If you'll see the classes above expected returned XML should be something as following:
<AuthenticationResponse>
<Result>
<ErrorCode>1020300</ErrorCode>
<ErrorDescription>Invalid username or password</ErrorDescription>
</Result
<Credit>0</Credit>
<UserID>0</UserID>
</AuthenticationResponse>
But the returning result is as following:
<AuthenticationResponse>
<Result />
<Credit>0</Credit>
<UserID>0</UserID>
</AuthenticationResponse>
In short, Result property belongs to the base class BaseResponse which is type of an other class ResponseCode . Hence property of base class is not serialized to XML.
How I can include the base class's property serialized to achieve the desired result?
In start BaseResponse was abstract class. I removed abstract keyword but no luck. I've played a lot with XmlIncludeAttribute also but problem still exists
Any body can point me to right direction?
Thanks in advance
Regards
Aftab Sindhi
.NET Application Developer
U.A.E
|
|
|
|
|
I found the reason of the problem and solved it.
Problem was in class ResponseCode . It's properties ErrorCode and ErrorDescription has ONLY get accessor while set accessor is needed to be shown in XML. I just added set accessor and result was as expected.
Regards
Aftab Sindhi
.NET Application Developer
U.A.E
|
|
|
|
|
Hello Friends,
I want to develop a news section on the site, this section will collect the latest news from some of web servise or like resource in XML or related format and will display in my developed news section.
How can I do this using C# & ASP.Net 2.0 ? If anyone of you have any idea, please answer me. I will be much thankful to you.
Many thanks in advance.
Navin C Pandit
E-Mail: navin2k6@gmail.com
|
|
|
|
|
Navin C. Pandit wrote: E-Mail: navin2k6@gmail.com
Bad idea. Expect loads of spam.
Navin C. Pandit wrote: this section will collect the latest news from some of web servise
Have a look at the various news providers, most have rss feeds which you can use.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Thanks lot for your nice responce n quick answer
|
|
|
|
|
|
This is by far the easiest method.
Anyone trying to implement this must be aware that directory on the server the application wants to use must have it's asp.net trust levels lowered to 'medium' - most server administrators will have this set to 'high' - which is probably default.
This was a stumbling block I came across when I tried using this.
|
|
|
|
|
John Bracey wrote: This is by far the easiest method.
And the most smartest one... As one dont need to find latest news as there are already tons of RSS / ATOM feeds available for free.
John Bracey wrote: application wants to use must have it's asp.net trust levels lowered to 'medium'
Yes .. good addition. Thanks.
|
|
|
|
|
Thanks lot for your nice responce n quick answer
|
|
|
|
|
You are most welcome...
Dont forget to click "Good Answer" if you like the solution.
|
|
|
|
|
Hii,
I am getting this error while using RSS feed on my application:
Error: "The remote server returned an error: (407) Proxy Authentication Required"
I am using yahoo rss feed, the XPath link is : http://rss.news.yahoo.com/rss/topstories
Plz suggest me, if you ahve any answer.
Thanks.
|
|
|
|
|
|
Navin C. Pandit wrote: How can I do this using C# & ASP.Net 2.0 ?
You can do it using RSS Feed as all suggested or you can read content from web sites using HTTPRequest and HTTPResponse. Now how to display them in your web sites depends on you.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thanks a lot for your nice answer.
|
|
|
|
|
I have searched in google to get information about "forgot password ?". but didn't satisfy.i need help for this code. i want code for forgot password. I have no idea how to send mail to the user email account to get new password. plz any one send me code and suggest me how to do it.
|
|
|
|
|
|
vinci007 wrote: i want code for forgot password.
No one here is going to provide the code to you.
Let's talk about the very basic implementation logic:
1. Create a module which will verify the existence of the user email which was used by him while registering with your website.
2. If email address exists, generate a random alphanumeric password (I hope you are not storing the user password in readable format) and send it to user's email.
3. Also, update the user's existing password with the new one just created in step 2.
4. User will receive his new password in his mail and can use the same for logging in.
|
|
|
|