|
New one wrote: Common.CreateMessageAlert(this,_errmsg);
}
This _errmsg i am getting from my sql stored procedure,...
in Else Parth just Write
ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", "JavaScriptMethod();", true);
cheers,
Abhijit
|
|
|
|
|
No not at all working,
Plz understand my probs,
My javascript alert msg in one cs file...,
This cs file method i am calling in my aspx page...,
Like this:
Common.CreateMessageAlert(this,_errmsg);
Now this _errmsg passing as a parameter for my cs file
In cs file code is like this:
public static bool CreateMessageAlert(System.Web.UI.Page aspxPage,string strMessage)
//Here getting that _errmsg as strMessage
{
string strScript= "<script language=JavaScript>alert( \""+strMessage+"\" )</script>";
if (! aspxPage.IsStartupScriptRegistered("strKey1") )
{
aspxPage.RegisterStartupScript("strKey1", strScript);
}
return false;
}
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
New one wrote: This cs file method i am calling in my aspx page...,
what does it mean ?are you calling cs methods from aspx page ? or what ?
cheers,
Abhijit
|
|
|
|
|
S i am calling cs file methods in my aspx page...,
In aspx page my script manager is there and in my cs file method i declared like this:
string strScript= "<script language=JavaScript>alert( \""+strMessage+"\" )</script>";
if (! aspxPage.IsStartupScriptRegistered("strKey1") )
{
aspxPage.RegisterStartupScript("strKey1", strScript);
}
return false;
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
|
Confusing
I think you are doing something wrong while calling the javascript function.
make Sure that Javascript code can't run at server side you can only Register it or
It is going to run at client side(Browser will run).
New one wrote: This cs file method i am calling in my aspx page...,
Like this:
Common.CreateMessageAlert(this,_errmsg);
Now this _errmsg passing as a parameter for my cs file
This is making me confused
Can you tell me what are you trying to do
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
No guys i will tell u,
See in one cs file i declared a method it have to give alert msg where ever i will call...,
So the code is like this: and the cs file name is(common.cs)
public static bool CreateMessageAlert(System.Web.UI.Page aspxPage,string strMessage)
{
string strScript= "<script language=JavaScript>alert( \""+strMessage+"\" )</script>";
if (! aspxPage.IsStartupScriptRegistered("strKey1") )
{
aspxPage.RegisterStartupScript("strKey1", strScript);
}
return false;
}
Now in my aspx page after add a data to database i call this method to show data has been updated like...,
So my aspx.cs code will be look like this:
if(_err==0)
{
Common.CreateMessageAlert(this,"Saved");//Here i am calling that cs file method and passing msg text "Saved" has to display
clearall();
RefreshData();
}
else
{
Common.CreateMessageAlert(this,"Not Saved");
}
The method is excecuting here i checked in debug mode...,
But its not giving the alert msg before that msg alert its moving to clearall() method execution
Now u guys getting?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
New one wrote: Now in my aspx page after add a data to database i call this method to show data has been updated like...,
Where is your apsx code to call this method
New one wrote: The method is excecuting here i checked in debug mode...,
Is it going in the if block ?
I got the things but want to see how you are calling aspx.cs method from aspx after which event and how ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi Mr.Abhijit & Sandeep Thanks for ur kind replies,
Ya in my cs file i have changed the code, its working fine:
System.Web.UI.ScriptManager.RegisterClientScriptBlock(aspxPage, aspxPage.GetType(), Guid.NewGuid().ToString(), "alert('" + strMessage + "');", true);
Once again thanks lot for u guys
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
well Done !!!
cheers,
Abhijit
|
|
|
|
|
iam having a text box where iam using to save this type of text
hi <username> age <age> mobile no is <mobile no=""> ...now iam saving this data in the database .now wen iam retriving this data it is taking the above content as tags and iam not getting the actual content which i saved it is getting like this
hi age mobile no etc.how to solve this problem
|
|
|
|
|
I've read your question three times and what you want is still not clear to me. Is it that you pasted XML and somehow turned off the 'auto encode HTML when pasting' option ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
sir, can you please check this post. I am also confused .
Thanks in advance.
Check Post[^]
cheers,
Abhijit
|
|
|
|
|
Please re-post your question so that at least i could understand it.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
I have One Excel sheet and i want record from that
excel sheet where first column rows contains Manager word
how do i use like query?
|
|
|
|
|
Hi friends,
I am using reports in my application. In reportviewer i am using local report in my code.Its working well. But for print icon display is needed in my application.So i am using server report. But errors occurred in the code.
The Error is " datasource is not a member of Microsoft.Reporting.WebForms.ServerReport". What can i do? I can't run the application using serverreport.
For ur's reference i put the code using local report
Page.Title = "Reports Based On Company"
dsGetValue = New DataSet
objReport = New clsReport
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.DataSources.Clear()
Dim report As LocalReport = ReportViewer1.LocalReport
dsGetValue = New DataSet
If paramCompanyName = "All" Then
'Temp DataTable to Concatenate the Address fields
dtTempTimeSheet = New DataTable
'Temp DataSet to Concatenate the Address fields
dsgetTempSheet = New DataSet
dtTempTimeSheet.Clear()
dsgetTempSheet.DataSetName = "PmsDataSet"
' Add the new table
dtTempTimeSheet = dsgetTempSheet.Tables.Add("DataTable3")
' Define the columns
With dtTempTimeSheet
.Columns.Add("strCompanyName", System.Type.GetType("System.String"))
.Columns.Add("strRelationshipType", System.Type.GetType("System.String"))
.Columns.Add("strAddress1", System.Type.GetType("System.String"))
.Columns.Add("strContactNo", System.Type.GetType("System.String"))
.Columns.Add("strWebsite", System.Type.GetType("System.String"))
End With
dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)
For intloop = 0 To dsGetValue.Tables(0).Rows.Count - 1
dbrow = dtTempTimeSheet.NewRow
With dbrow
.Item("strCompanyName") = dsGetValue.Tables(0).Rows(intloop)(0)
.Item("strRelationshipType") = dsGetValue.Tables(0).Rows(intloop)(9)
.Item("strAddress1") = dsGetValue.Tables(0).Rows(intloop)(4) + "," + dsGetValue.Tables(0).Rows(intloop)(10)
.Item("strContactNo") = dsGetValue.Tables(0).Rows(intloop)(6)
.Item("strWebsite") = dsGetValue.Tables(0).Rows(intloop)(2)
'Add New Row
dtTempTimeSheet.Rows.Add(dbrow)
End With
Next
End If
'This Case Works If The Selected Company Name Is All
If paramCompanyName = "All" Then
Select Case dsgetTempSheet.Tables(0).Rows.Count
Case Is > CInt(0)
report.ReportPath = "ReportsNewUI/CompRelType.rdlc"
Case Else
report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
End Select
Try
Dim strDatasource As New ReportDataSource()
strDatasource.Name = "PmsDataSet_DataTable3"
strDatasource.Value = dsgetTempSheet.Tables("DataTable3")
report.DataSources.Add(strDatasource)
Catch ex As Exception
End Try
'This Case Works If The Selected Company Name Is All
ElseIf paramCompanyName <> "All" And paramstrRelationshipType = "All" Then
dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)
Select Case dsGetValue.Tables(0).Rows.Count
Case Is > CInt(0)
'report.ReportPath = "ReportsNewUI/detailedReportForCompanyDetails.rdlc"
report.ReportPath = "ReportsNewUI/ReportWithCompanyInformation.rdlc"
Case Else
report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
End Select
Try
Dim strDatasource As New ReportDataSource()
strDatasource.Name = "PmsDataSet_DataTable3"
strDatasource.Value = dsGetValue.Tables("DataTable3")
report.DataSources.Add(strDatasource)
Catch ex As Exception
End Try
ElseIf paramCompanyName <> "All" And paramstrRelationshipType <> "All" Then
dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)
Select Case dsGetValue.Tables(0).Rows.Count
Case Is > CInt(0)
'report.ReportPath = "ReportsNewUI/detailedReportForCompanyDetails.rdlc"
report.ReportPath = "ReportsNewUI/ReportWithCompanyInformation.rdlc"
Case Else
report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
End Select
Try
Dim strDatasource As New ReportDataSource()
strDatasource.Name = "PmsDataSet_DataTable3"
strDatasource.Value = dsGetValue.Tables("DataTable3")
report.DataSources.Add(strDatasource)
'Send Paramteres To Report File
'Dim StatusParameter As New ReportParameter()
'StatusParameter.Name = "strCompanyName"
'StatusParameter.Values.Add("Company Name" & " " & paramCompanyName)
'Dim parameter() As ReportParameter = {StatusParameter}
'report.SetParameters(parameter)
Catch ex As Exception
End Try
End If
Finally
dsGetValue = Nothing
objReport = Nothing
I hope ur's reply soon.
Thanks
Every Successful Person Have A Painful Story
|
|
|
|
|
how to copy structure of gridview to other gridview
|
|
|
|
|
What do you mean by structure? You mean columns?
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Mhiny wrote: how to copy structure of gridview to other gridview
do you want copy one grid view data to another Grid view or Copy only the fields ?
cheers,
Abhijit
|
|
|
|
|
yes.i want to copy column's structure from first gridview to second gridview at runtime.
|
|
|
|
|
I guess you should add columns dynamically rather then copying them.
An after thought to my previous answer. I think DataGridView.Clone property will solve your problem as well
Ahsan Ullah
Senior Software Engineer
modified on Tuesday, August 19, 2008 1:36 AM
|
|
|
|
|
then do the same thing that you have done for grid1.
cheers,
Abhijit
|
|
|
|
|
|
Hi,
Me and my friends are developing a software.The software is for designing and customising business cards.
In this software user can rearrange the name and address in it.that means user can drag each control and place it in their own decision.In it we cannot restore the whole one with keeping position.in one resolution it is working perfectly.but changing the resolution a computer.it is not keeping the position.
Could you help me to solve this problem.
thanks and regards.
Rasma
www.rasma.dom.ir[^]
|
|
|
|
|
You're doing drag and drop in a web application ?
Obviously you need to write resolution agnostic code.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|