|
Hi
I need javascript code for creating Messagebox in C# ,&
how we can call this javascript in C#,I m using asp.net 2.0 with C#.
Thanks
Replay ASAP
CARE CAREER
CARE CAREER
|
|
|
|
|
Care Career wrote: I need javascript code for creating Messagebox in C# ,&
What do you mean by that? You want to create it in javascript or C#.
Incase of javascript it is alert("Message goes here");
And you can attach the javascript to a control by Attributes.Add method.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi
Thanks
I want to write code in javascript ,When i was attaching this javascript file then it gives error. I have written Button2.Attributes.Add(String Key,value);
What I have to write for String key & value?
Thanks
CARE CARRER
|
|
|
|
|
Button2.Attributes.Add("onclick","alert('message');");
We Can Do Anything, If We Want It
|
|
|
|
|
For string Key you need to write the event on which you want to call the javascript e.g. "onclick" and the value is javascript part. Suppose you have a button btnUpdate the it will be something like this:
btnUpdate.Attributes.Add("onClick", "alert('Message goes here');");
In place of alert you can also call a method written in javascript.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi
Thanks for replay.
Its ok .But if I write Javascript Function in the place of String value it gives error.So plz tell me I have added new file eg. A1.js file in this I have written. function Msgdispaly()
{
alert("Hello")
}
or
I have to write
function Msgdispaly()
{
alert("Hello")
}
means tell me How we call javascript file in asp.net with c#.
I m using Visual Studio 2005,asp.net 2.0 with C#
Thnks
CARE CARRER
|
|
|
|
|
What you need to do is first write a javascript function in the HTML part of the page like this:
<script language="javascript">function test(){alert("Hello");}</script>
and then you can attach this to the control you want in the pageload event like this:
BtnView.Attributes.Add("onClick", "javascript:test();");
Best Regards,
Apurva Kaushal
|
|
|
|
|
hello,
you can use from this method:
this.Controls.Add(new LiteralControl("<script>alert('Message Here');</script>"));
We Can Do Anything, If We Want It
|
|
|
|
|
Thanks
Can you tell me( this.Controls.Add(new LiteralControl("alert('Message');")); e.g If my record is saved ,updated & deleted ,so for displaying message 3 times i have to write this line of code in PAGE LOAD event.
Thanks
CARE CARRER
|
|
|
|
|
place codes in PageLoad Event isn't good method in web application.
please send me your codes for Indagate it.
We Can Do Anything, If We Want It
|
|
|
|
|
Hi
Its very simple code wich i have written ,tell me for every new meassage i have to write this code again & again.There is no method in C# For displaying message like Msgbox in VB.
Thnks
CARE CAREER
|
|
|
|
|
Hi
Its very simple code wich i have written ,tell me for every new meassage i have to write this code again & again.There is no function in C# For displaying message like Msgbox in VB.
Thnks
CARE CAREER
|
|
|
|
|
hi all,
help me in generating the crystal reports in webapplication asp.net 2.0 using c#.net
|
|
|
|
|
in first step you must create your report by
WebSite >> Add New Item and select CrystalReport Object then Set Name Of Your report and press add. then create your report.
if you passed this step in the second step must be load it by your codes.
html codes:
<form id="form1" runat="server">
<div>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" />
</div>
</form>
c# codes:
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CrystalDecisions.CrystalReports.Engine.ReportDocument rptFile = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
rptFile.Load(Server.MapPath("YourReportFile.rpt"));
DataTable dt = new DataTable(); // this DataTable is Source Of your report that made by sqlquery or any data in table syntax
rptFile.SetDataSource(dt);
CrystalReportViewer1.ReportSource = rptFile;
CrystalReportViewer1.DataBind();
}
}
We Can Do Anything, If We Want It
|
|
|
|
|
Hello,
I have a problem with me.The problem is like..in my database there is a field sex and the value is stored in the form of 'M or F' while showing the value is grid
i have to show with full value like if the sex is 'M' it will be written as 'Male' otherwise 'Female'
One method we can do is using sql query we can select appropriate value and bind that value to grid...but this is not the case i needed .i need to do using Datagrid propertise or methods..
Please anybody clarify my doubts....
Regards
Alex.
|
|
|
|
|
Get it there are lot of articles regarding the DataGrid here.
DataGrid[^]
Regards,
Satips.
|
|
|
|
|
Use the Item Data Bound event of Datagrid.
|
|
|
|
|
Hi..
I developed one website in which i used asp.net default validation control for validaton. They well work on localhost but they not worked whwn i upload them on live server.
why this happens?
actually they worked on one page "register.aspx" on live server, but not other pages on live server.
|
|
|
|
|
maybe some applications insstalled on your pc that uses from some dll files in your pc.
We Can Do Anything, If We Want It
|
|
|
|
|
I have added dll named and created the object.Here is the code:
Imports Outlook = Microsoft.Office.Interop.Outlook
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim app As Outlook.Application = New Outlook.ApplicationClass()
Dim NS As Outlook.NameSpace = app.GetNamespace("MAPI")
Dim inboxFld As Outlook.MAPIFolder = NS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
For Each t As Outlook.MailItem In inboxFld.Items
Try
Response.Write(t.Subject)
Catch ex As Exception
End Try
Next
Catch ex As Exception
End Try
End Sub
If any undelivery mail is there in the Indox it thorws an exception saying:
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063034-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Can anyone tell me how can I handle this as I need to read all the mails and seperate the delivery mails and undelivery mails.
Also how can I make the reading from date to date.I mean I need to read only mail a week back but not all.
Thanks in advance...
|
|
|
|
|
Please help count user visit in website
|
|
|
|
|
I think this will help you
<br />
protected void Application_Start(Object sender, EventArgs e) <br />
{<br />
<br />
<br />
Application[RUNNINGCOUNT] = Visit.GetTotalCount(); <br />
<br />
}<br />
<br />
protected void Session_Start(Object sender, EventArgs e)<br />
<br />
{ <br />
<br />
Application[TOTALUSERS] = Convert.ToInt32(Application[TOTALUSERS]) + 1; <br />
<br />
<br />
Application[RUNNINGCOUNT] = Convert.ToInt32(Application[RUNNINGCOUNT]) + 1; <br />
<br />
if((int)(Application[TOTALUSERS]) >= Convert.ToInt32((ConfigurationSettings.AppSettings["MAX"])) )<br />
<br />
{<br />
<br />
Visit.Count((int) Application[TOTALUSERS]); <br />
<br />
<br />
Application[TOTALUSERS] = 0; <br />
<br />
}<br />
Regards,
Satips.
|
|
|
|
|
I have created one very simple web service say helloWorld which accepts one string and concate with "Hello" word.and its located in my localhost only.
Here is some behavour with it.
(1) i can access this web service synchronously without an issue.like
Dim webServ As New localhost.Service
Response.Write(webServ.HelloWorld(TextBox1.Text))
(2)now i am trying to call it asynchronously. Like this
Dim ar As IAsyncResult = webServ.BeginHelloWorld(TextBox1.Text, Nothing, Nothing)
While (True)
If ar.IsCompleted Then
Exit While
End If
End While
Response.Write(webServ.EndHelloWorld(ar))
(3) Now this code is executes file on the other machine i have ,but is not been able to call on my machine.I am receiving following error on the execution of above code.
The attempted operation is not supported for the type of object referenced
" at System.Net.Sockets.Socket.get_ConnectEx()
at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.UnsafeBeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)"
System.Net.WebException = {"Unable to connect to the remote server"}
(4) i done long googling but could'nt get the exact solution.
(5) I also tried by removing my framework 2.0 ,visual studio 2005 and IIS as well.
(6) Some blogs says its network error,i also tried by repairing my network drivers but problem persists as it is.
(7) Some blogs also suggested that i do have third party network protocols and that may causes the blocking of Http Request for async. call.then i also removed all such softwares from my machine,but the same result.
I am very frustated with this issue and hampered my development.
Any kind of help is most welcomed.
lots thanks in advance.
|
|
|
|
|
Hi All,
I want to learn Webservices .So pls suggest Some sites which will help to increase my knowledge..
1.Creation of webservices and Usage in RealTime Envirounment.
2.Also Covers Mandatory Topics in Webservices side..
Thanks..
|
|
|
|
|