.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

Formating Querystrings

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net
On the SentItems.aspx
public enum Mode
   InboxPage = 1,
   DeletedPage = 2,
   SentPage =3

Protect void SentGrid_RowDataBound(object sender, GridViewRowEventArgs e)
   Gridview gv = (Gridview) sender;
   GridviewRow gvRow = e.Row;

   if(gvRow.RowIndex >= 0)
      string.Format("ViewMessage.aspx?Mode={0}", Mode.Sent);
      ///Other stuff

on the ViewMessage.aspx

// here's where I'm have trouble

private void GetMode(int messageMode)
   if(Request["mode"] != null)
       what is next thing to do???

How do I get my string??? 

View Complete Post

More Related Resource Links

Why does text and page formating changes randomly?

Hallo there, First of all I don't know if I am posting in the right forum, so let me know if there is another forum for this issue. My form text and entire page formating changes once a while and I don't know why. e.g. font color, background color of certain paragraphs or table look changes, it seems randomly, I think it has something to do with the style but I don't know how to avoid this repeated text formating loses. In details: U am using Visual Studio 2010 Professional and is set for Visual Web Development. I create a new form e.g. default.aspx link it to a master page and the master page is linked to a css file (style sheet file) that contains only general and basic formatings and I hardly change any thing in this css file. I format my default.aspx. and later the formating chanegs by it self and I have to change it back manualy. Most of the time I have to create a new form. link it to the master page and copy the text, tables and so on from the original page to the new page and then delete the original page. but even the new page chnages later. and so on. I don't know how to avoid that! Any idea's? Thanks in advance  Michael Najar wishes you great day

Formating Text using Regex

Hello Everyone,   I have extracted some text from HTML pages & writing it to a Text file. Text is scrambled everywhere in the file after saving.   in the output text there some new line , tabs etc ... is there any way to remove them ? using Regex ?? text i am getting after extraction :- ( checked using Debug ) Pradeep \r\n\t\t\t\t\t\t\t    \r\n\t\t\t\t\t\t      G\r\n                               \r\n                                 \r\n                                \r\n                                State College \r\n                                 \r\n 

Converting Date to String and Formating it Linq to SQL

Hello I have problem in converting date to string I am using cstr(p.tripstart) , which is returning Date as 12 Aug 2010 12:AM   I need to make formating   This is my code : Dim db As New TripsLinqDataContext Dim listtrips = (From p In db.Trips _ Group Join c In db.Countries On p.TripCountryID Equals c.TripCountryID Into countrylist = Group _ Select New With {.Tripdetails = p.TripDescription + " - " + p.TripCityList + " - " + CStr(p.tripstart) + " - " + CStr(p.TripDays), _ .Tripid = p.TripID}).ToList tripboxlist.DataSource = listtrips tripboxlist.DataTextField = "Tripdetails" tripboxlist.DataValueField = "Tripid" tripboxlist.DataBind()     Regards  

How to create HTML from XSLT with actual formating

Hi, I am creating HTML script using XSLT using an XML file. I am creating that input XML file from the database values. The database values are contains the data with some html formatting tags like <b>values</b> etc. for Ex:I have the table.EmployeeID CommentsEMP101   Some normal comment with <b>Value with bol</b> I required to create XML file with the fomatted comment, but when I create XML it contains &gt;&lt; etc., like <Employees><Emp id="EMP101"> <Comments>Some normal comment with &lt;b&gt;Value with bol&lt;/b&gt;<Comments></Emp></Employees> When I create HTML using XSLT, the values again contains the &gt;&lt; characters instead of the actual formating what the database stores. Please let me know how to solve this issue. I required the output HTML will be inthe same format what the database stored. Many Thanks,Kelvin.

SQL Formating

Hello all ! Here is my dilema! select counterdatetime, countervalue from counterdata; counterdatetime          countervalue ------------------------ ---------------------- 2010-09-13 21:28:12.359  0 2010-09-13 21:28:27.359  9.49375 2010-09-13 21:28:42.359  9.88472222222222 2010-09-13 21:28:57.375  12.5145833333333 I wish to be able to select the data in the following format: counterdatetime          countervalue ------------------------ ---------------------- 13-09-2010 21:28:12  0 13-09-2010 21:28:27  9.49 13-09-2010 21:28:42  9.88 13-09-2010 21:28:57  12.5 Please help, wanting to be able to graph this data so that the date + time are along the bottom and the counter up the vertical but need this format first

datetime formating with string.format


I have a table in my SQL DB that is a DateTime table, what I want to do is take the numeric datetime it stores and convert it to a long date (i.e. 12/12/2012 conversts to December 12, 2012). Seaching the forums it looks like the string.format is the way to go and searching for info on that I found http://www.csharp-examples.net/string-format-datetime/ which lists all the different formats but they do not list a formating string to convert to the format I want to use. Does anyone know what format string I would use to convert a numeric date to a long date like I want? And can you show it in a code example because I am not 100% sure I understand the code examples shown on that site.

Conditionally formating a row

On the 1st row and column of data on the lay out I have 'Fields!Works_Order_Number.Value', which is sorted based on the data.  I would like to conditional format the row so that if the Fields!Works_Order_Number.Value in the row above is the same value then colour it grey if not leave transparant

Create validation formating


I want to create a sort of validation formatting (like regex).  It doesn't have to actual validate; just make it easier for the user to enter the correct number of character needed.  I want something like domain: [xxx].[xxx].[xxx] (so it only allows 9 numbers, 2 periods).

So for instance when the user moves to the field they would be presented with one field with ability to enter 3 numbers.3 numbers.3 numbers

Any Ideas?  Thanks,


How to input line breaks and formating in textbox with multilines ?


I have a web form in which anyone can fill out the information and i recieve the information.

<asp:TextBox ID="Body" runat="server" Columns="55" Height="101px" Rows="30" TextMode="MultiLine"

The problem is while entering the information in this text box, if anyone used enter line or different line or any kind of formatting, as a result i don't get the formatted page or with lines. I see only a paragraph which is very difficult to read and understand.

How to make my textbox compatible with all kind of formatting options so that even if someone paste information from word etc in the text box , i should get the formatter information just like the user pasted the information in the text box...

incorect date value and formating on display form


On the list display form i have start date field which shows date in the folloving format : 2010-07-06T22:00:00Z

First it shows the wrong date since in edit from i see 7/7/2001

secondly the format is wrong since i choosen date only field so i don't want to see time and zone.

Does anybody knows why this happens and how to fix it?

Querystrings in remapped URL's


 Hello everyon and thanks for your help in advance.  I amworking on an application that utilizes URL remapping.  For example, the page /content/this_is_my_article remaps to ~/content.aspx.  This works fine, however, I am in need of passing other parameters in the URL such as /content/this_is_my_article/?PageNumber=3.  However, when I try to retrieve the page number using Request.Querystring("PageNumber"), the request retrives nothing.  I am not sure why this is happening or how to pass the parameters.  Any help would be greatly appreciated.

RDLC report Text box value formating


Hi all,

My rdlc reports showing decimal value like 25.5000  . I want to show it in 2 decimal point in report ( Should 25.50 )

pls Let me know how i can do it.

Thank you

net.tcp message formating errors Message.GetBody


Man! I have been trying to figure this one out... but with no luck. In the end, all i am trying to do is notify the client with the payload being an object graph more complex than a simple value type.

I am getting an error when using the GetBody method of the message object. 

the typed message converter reference


private static TypedMessageConverter _ClientReportStatusMessageConverter = TypedMessageConverter.Create(


the report status message object

 /// <summary>
  /// The client report status message is used
  /// to transfer report status change messages
  /// to the client
  /// </summary>
  public class ReportStatusMessage


URITemplate Inconsistency... QueryStrings Parameters Sometimes Null - Sometimes Not...

Hello all,

I've encountered a strange inconsistecy in the way WCF parses URIs?

My contract looks like:

    <OperationContract()> _
    <WebGet(UriTemplate:="{CampaignID}/objects?page={Page}&pagesize={PageSize}")> _
    Sub getObjects(ByVal CampaignID As String, ByVal Page As String, ByVal PageSize As String)

    <OperationContract()> _
    <WebInvoke(Method:="POST", UriTemplate:="{CampaignID}/objects")> _
    Sub addObject(ByVal CampaignID As String)

getObjects cannot be run without parameters - in this case, it'll return "Method Not Allowed".

However - if addObject is removed ... getObjects CAN run without parameters (Null will be passed in for Page/PageSize).

Why is there an inconsistency in the way WCF processes query string parameters - is there a way to fix this inconsistency... i

formating string


HI all,

I have word in one string more than 800 and all separated by comma, i need to insert $ char after each 10 word in my same string without modify or replacing anything. i was trying using split but it remove the comma.

Could you please give me right idea/code to do this job.

dim mystr as string = "a,b,w,t,3,c,d,r,y,d,e,dt,e,4,3,ff,8,65,f,f56,g,o,2,3,tyr,43,d,t,3d,e,4,e,3e,tr"

it should look like : dim afterformat as string = "a,b,w,t,3,c,d,r,y,d,e,$dt,e,4,3,ff,8,65,f,f56,$g,o,2,3,tyr,43,d,t,3d,e,$4,e,3e,tr"

I will appreciate for your replies.

Thank You

Page Methods querystrings are null



I'm having problems with accessing querystring params in my page method. Everywhere I read it says you can access querystrings just fine, but when I try it just returns null, what's the problem?

same problem I found -  http://stackoverflow.com/questions/1765188/access-to-querystring-session-from-a-static-method


thanks in advance

Formating tab for string.Format


i have textFile like this


some thing



i want when give parametr 0 to string.Format like this "Jack\r\nMicheal"

my result be


some thing






some thing





C# Is My World
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend