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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Format Message Box Problem!

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :ASP.Net


How can I format a display message box. Actually I using following script for display successfully message.

msg = "Record Inserted Sucessfully!"

ClientScript.RegisterStartupScript(GetType(Page), "alert", "<script>alert('" & msg & "');</script>")

But I need some change here.i need to display a Challan number to user through message box like

msg = "Record Saved!" + "Your Challan No. is" + txtChallanNo.Text.ToString()


            ClientScript.RegisterStartupScript(GetType(Page), "alert", "<script language=JavaScript>alert('" & msg & "');</script>")


I need message box should display like following


Record Saved!Challan No. is:-100.


Is it possible?if not please suggest me suitable way.

Thanking you


View Complete Post

More Related Resource Links

Problem with WCF: Error while reading message framing format at position 13665 of stream (state: Rea



we're using the net.tcp binding, server is self-hosted.

One of our clients experience the following problem randomly appearing on each client couple of times a day:

System.ServiceModel.ProtocolException, System.ServiceModel, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089

Error while reading message framing format at position 13665 of stream (state: ReadingEnvelopeBytes)

The exception appears on the client. I analyzed the WCF trace of the server and there are no exceptions.

What can be the cause of the exception?

I'd really appreciate any help, because the client is in production and this brings lots of problems.


How can I solve this problem?::Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.Cryst


I upgraded my web application from visual studio 2003 to 2008. When I want to create a report in visual studio 2008 and receiving this error at runtime. I am able to compile but when runnning thats when I am getting this error.

How can I solve this problem? please help.

Compilation Error

Server Error in '/IRPSDEV' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\10.5.3700.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\irpsdev\9e97e0a9\94a2ecd\assembly\dl3\151eb571\00df56e1_6064c201\CrystalDecisions.Web.DLL'

Source Error:

Line 161:        
Line 162:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 163:        private global::CrystalDecisions.Web.CrystalR

My problem with an gridView, Input string was not in a correct format.

Hello all ! I'am actually encounter problem with an gridView which is composed of five columns, the both first are string type, third is date and the two last are linkbutton to edit or delete rows. On clicking edit button, i catch good event to edit and traitment  work fine but on living function an error occur with this message : error : System.FormatException: Input string was not in a correct format. stackTrace :   [FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7471479 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119 System.Web.UI.WebControls.GridView.GetRowIndex(GridViewRow row, String commandArgument) +99 System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +602 System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +207 System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 System.Web.UI.Page.ProcessRequestMain(Boolean inclu

Usual solutions not the problem for Format of the initialization string does not conform to specific

I know that there are normally two causes/solutions for the "Format of the initialization string does not conform to specification starting at index 0" error message.  The two normal suggestions are a problem with the connection string or it is surrounded by quotes in Dimming the connection. I get the message while running in debug (though it is pulling the selected row ID value correctly).However neither of those are the case in my file.  I know the connection string is configured correctly because it works in the rest of the page.  Further I don't have quotes in the Dim connection part.  Relevant bits of code below.Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.ImageButton Imports System.Web.UI.WebControls.DataControlField Imports System.Data Imports System.Data.SqlClient Imports System.Configuration Imports System.Object Imports System.DirectoryServices Partial Class Default2 Inherits System.Web.UI.Page 'Private auth As authenticate 'Private dt As DataTable 'Private programs As DataRow() Private dbConnection As String = "KMConnectionString" . . . Sub btnPlay(ByVal sender As Object, ByVal e As EventArgs) 'grab video ID Dim videoID = GridView1.SelectedValue.ToString() Response.Write(videoID) Dim con As New SqlConnection(dbConnection)


Error in query: select * from geodesic_group_attached_price_plans where group_id = and price_plan_id > 0. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and price_plan_id > 0' at line 1

Suggest controls for the data format shown in message.

Hi all,  I have to display data in following format in asp.net. Please suggest me the best suited control for the same. Any help with code, rather than just the control names would be much appreciated.thanks in advance.-Harshal Month Category Budget ($) Actual ($) Updated Budget ($) Completed August 2009 --> CMG0 --> -$22,294,000.00 $0.00 -$22,294,000.00 Y TOTAL: -$22,294,000.00 $0.00 -$22,294,000.00   September 2009 --> CMG0 --> $0.00 $0.00 $0.00 Y TOTAL: $0.00 $0.00 $0.00   October 2009 --> CMG0 --> $0.00 $0.00 $0.00 Y TOTAL: $0.00 $0.00

problem in date format in sql 2005

I am new to sql2005  My problem is,  I send a date parameter (@fdt  and @Tdt)   like "DD/MM/YYYY" format through Sql reporting services My query is select  * from deposits where Depdate >= @fdt and Depdate <=  @tdt in the aove query there is no record has been fetched   But i give like this,  Inthis case i get a resultselect  * from deposits where Depdate >= '2010/04/01' and Depdate <= '2010/08/31' pls tell me how can i convert the date to "yyyy/mm/dd"    in where condition   Thanks Gk  

Message Display Problem



I am facing a  strange problem .i use following code for show successfully message to user.so it is working fine but problem is when I go another page and came back same page again  through  browser back button again successful message display.

For example suppose there are two page i.e one.aspx nad two.aspx.  i  save one.aspx record then message display me that "Record Insert Sucessfully!!" then I go to two.aspx and when I came back again one.aspx by browser back button again same message are display again

please someone help me.

Script for message

ClientScript.RegisterStartupScript(Me.GetType(), "alert", "<script language='javascript'>alert('Record Updated Sucessfully..')</script>")

Use like

Public Sub SAVEDATA()



            MYTRANS = myConnection.BeginTransaction()






Problem with Configuration of Message Inspector

I'm hoping someone might know what I am doing wrong. I'm trying to setup message interceptors and am trying to apply them to all of my services via the web.config. I've been working on it for hours but keep getting the following error:

Parser Error Message: The type 'AdventureWorksService.
Interceptor.ListenerServiceBehavior, AdventureWorksService.Interceptor, Version=,
        Culture=neutral, PublicKeyToken=null' registered for extension 'TestInterceptor' could not be loaded.

I have the classes under a the 'AdventureWorksService.Interceptor namespace in my web project.

Here my web config:

<?xml version="1.0"?>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true">
        <add relativeAddress="~/DataService.svc" service="AdventureWorksDataService"/>
    <!--For REST-->

Problem converting varchar values to numeric format for comparison


I've got an SQL-2008 database containing our network inventory (it's from LanSweeper - a low-end and very recommendable network management tool). In a table are all logins with the IP-address of that moment, where the IP-address is defined as VARCHAR(15).

I need to compare IP addresses with those in the table defining the IP segments, where the segment addresses are also defined as VARCHAR(15).

In order to be able to compare reliably, I need to convert the addresses to numeric format. I cooked up the following SELECT statement for that:

SELECT TOP (100) PERCENT Ipaddress, (
CAST(SUBSTRING(Ipaddress, 1, CHARINDEX('.', Ipaddress, 1) - 1) AS DEC) * 1000000000 +
CAST(SUBSTRING(Ipaddress, CHARINDEX('.', Ipaddress, 1) + 1, CHARINDEX('.', Ipaddress, CHARINDEX('.', Ipaddress, 1) + 1) - 1) AS DEC) * 1000000) +
CAST(SUBSTRING(Ipaddress, CHARINDEX('.', Ipaddress, CHARINDEX('.', Ipaddress, 1) + 1) + 1, CHARINDEX('.', Ipaddress, CHARINDEX('.', Ipaddress, CHARINDEX('.', Ipaddress, 1) + 1) + 1) - 1) AS DEC) * 1000 +
CAST(SUBSTRING(Ipaddress, CHARINDEX('.', Ipaddress, CHARINDEX('.', Ipaddress, CHARINDEX('.', Ipaddress, 1) + 1) + 1) + 1, 3) AS DEC) AS IP, Computername, logontime, Username, ADsite,
FROM dbo.tblCPlogoninfo

ModelState.AddModelError Message Format


Is it possible to preserve formatting when adding error message text to be redisplayed on the form. I have some error messages that I need to preserve page breaks in. I have tried using '<br />', '<br>', '\n' 7 '&lt;br&gt;' but to no avail. The break symbol itself is always displayed.

i want my error messages to display like this



Error Message 1 Line 1


Error Message 1 Line 2

without displaying the <br> as text.

but instead I get the following;

Errors: <br>Error Message 1 Line 1<br>Error Message Line 2

 Any ideas?

date format problem


I require a date formatted as "dd/mm/yyyy" regardless of culture, and have tried the following with the current date.

The current date is 18/10/2010 i.e. 18th October 2010.
Both of the following formatting attempts end up with a result of "18/00/2010", not  "18/10/2010" as expected i.e. the month is being set to "00", not '10" as it should be.

Why is this happening? it is driving me crazy.

Dim DateString as string
DateString = Date.Today.ToString("dd/mm/yyyy")
DateString = String.Format("{0:dd/mm/yyyy}", Date.Today)


Serious problem on UpdatePanel and GridView (Input string was not in a correct format)


I have implemented a custom gridview paging method using the pagertemplate tag. The source code is the following:



<asp:UpdatePanel ID="UpdatePanel1" runat="server">
      		<fieldset class="ads">
			<br />            
            <asp:GridView ID="gvResults" runat="server" AutoGenerateColumns="False" DataKeyNames="CHId" CssClass="grid" GridLines="None" AllowPaging="true" AllowSorting="true&q

Error while reading message framing format at position 0 of stream (state: ReadingUpgradeRecord)


While calling a WCF service(service is hosted as a windows service) from a client application, below exception is being thrown:

System.ServiceModel.Security.MessageSecurityException: The server rejected the upgrade request. ---> System.ServiceModel.ProtocolException: Error while reading message framing format at position 0 of stream (state: ReadingUpgradeRecord) ---> System.IO.InvalidDataException: More data was expected, but EOF was reached.   --- End of inner exception stack trace ---   --- End of inner exception stack trace ---  Server stack trace:   at System.ServiceModel.Channels.ConnectionUpgradeHelper.ValidateUpgradeResponse(Byte[] buffer, Int32 count, ClientFramingDecoder decoder)   at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)  

Form Format Problem



I have some problems on formatting the view created by the MVC model. 

        <div class="editor-label">  
            <%= Html.LabelFor(model => model.username) %>  
        <div class="editor-field">  
            <%= Html.TextBoxFor(model => model.username) %>  
            <%= Html.ValidationMessageFor(model => model.username) %>  


For example, this example will show me the username field label as "username". However, I want to format the label to show "Username". Is there any methods to format the label text?

Also, since a user can be a male or female, is it possible for me to use radio button to represent the gender field (do not use the text field)? If it can, which html coding should I use?

Sp 2010 Conditional format problem


Goal: compare two columns in a list and highlight the background (cell value) if the values do not match.

Example list

Title              Rev           Myname

my doc         01             00

So I select the "XSL value of" cell of Myname (in this case 00),

select conditional format, format selection,

under field name select MyName, comparison (not equal), Value (@Rev) (more fields, select column labeled Rev)

Set Style cell background value = Red

Results: All items are highlighted in the Myname column whether they match or not.

However, if I change the conditional format statement to:

under field name select MyName, comparison (not equal), Value "00" (or some static number)

Style  cell background value = Red

Results: Works as expected

Problem with Implementing Transport Message Security with WCF 4.0 and VS 2010



I'm working on a tree tier project in this solution I have tree project ,

the Service layer,the ServiceContract Layer and presentation layer

At first I implemented it without security and it worked  properly,

But when I tried to add Transport Message security with SSL I faced some problem here is some of my code :

web.config in service layer:


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