|
Call your JavaScript function like below from your aspx page:
"JavaScript:Validate('<%= serverControlID.ClientID%>')"
Here, the Validate javascript function receives the Client Id of the server control & perform your required operation.
I hope, it will help you.
Jey
|
|
|
|
|
Hi there i am a newbie in VB .Net, I am getting this error on my Page_Load DataModule is not a member of 'System.Security.Principal.IPrincipal' and I do not have any roles yet on my application, just a simple class to populate a datagrid, is there a way i can turn this security off? what is wrong? i am using VS 2008 with v3.5sql server 2005. Please help
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Security
Imports System.Security.Principal
Imports System.Web
Imports System.Web.UI
Public Class User
Dim mDataPath As String
Public Shared DataModule As User
Function GetConnection() As SqlConnection
Return New SqlConnection("Server=GMPROD13\GMFE;Integrated Security=True;Database=GM_Escheatables")
End Function
'Public Overloads Function GetUsers() As DataSet
' Return Me.GetAllUsers("USER_EMPL_NO")
'End Function
Public Overloads Function GetAllUsers() As DataSet
Dim conn As SqlConnection = GetConnection()
Try
Dim cmd As New SqlCommand("Escheatables_GetAllUser", conn)
Dim ds As New DataSet
Dim adpt As New SqlDataAdapter(cmd)
Try
adpt.Fill(ds, "users")
Finally
adpt.Dispose()
End Try
Return ds
Finally
conn.Close()
conn.Dispose()
End Try
End Function
Public Sub New(ByVal sDatapath As String)
MyBase.new()
Me.mDataPath = sDatapath
User.DataModule = Me
End Sub
End Class
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections.Generic
Imports System.Security.Principal
Partial Class Escheatables_UserList
Inherits System.Web.UI.Page
Private dsUsers As DataSet
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
dsUsers = User.DataModule.GetAllUsers
Me.GridView1.DataSource = dsUsers
Me.GridView1.DataMember = "users"
'Me.GridView1.ReadOnly = True
Me.GridView1.DataBind()
End Sub
End Class
|
|
|
|
|
Hi ..
I want to use Response & Server object in my class file. Somewat like this ..
String path = Server.MapPath(strRequest);
Response.Clear();
Bt it says objects Response & Server does not exist in this context. How to use this objects in class file??
|
|
|
|
|
Use HttpContext.Current.Response . Always check HttpContext.Current for NULL.
|
|
|
|
|
You need to inherit the System.Web.UI.Page Class
Ex:
Public Class MyClassName : System.Web.UI.Page
---Your code
End Class
|
|
|
|
|
Shaik Haneef wrote: You need to inherit the System.Web.UI.Page Class
This is potentially one way to achive the desired result, but you by no means need to inherit from this class to obtain a reference to the current Http Context.
|
|
|
|
|
Dear Friends,
Thanks for the different type of helps in time to time matter,
Currently i am working on an project in which i am storing different type of extension document in sql database at column with data type "image" all working properly. but today i found an bug in it that if i am trying to open any html file it is open in same browser where my web applcation is running......
Is it possible to open that file to different browser?
Please help me regard this.
Thanks in advanced.
My code to open the stored doc is as beow
Code: C#
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=<filename>" + <file extention="">);
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(<byte array="" of="" the="" file="">);
Response.End();</byte></file></filename>
Sasmi
|
|
|
|
|
Put a link which has a target as _BLANK and it will open this page in a new window.
Sasmi_Office wrote: with data type "image
Future SQL server versions won't support this datatype. If possible change this to VarBinary(MAX)
|
|
|
|
|
I don't understand where to put the link which has a target as _BLANK, because the response object directly opening the page retrieved from the sql database as mention in my above code..
Sasmi
|
|
|
|
|
Hello,
Friends
I am using Mysql ( version 5.0) as database and C# for programming the page. I am unable to store the date value into the DB i tried with converting the datetime value to yyyy-MM-dd still i get 0000-00-00 in the database.
and at the time of getting back the data a error is thrown
" unable to convert mysql datetime to system datetime "
Please if anyone knows how to solve this issue please let me know
Thanks and Regards
Krazy programmer
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Use date format:
<br />
DATE_FORMAT(DateValue, '%yyyy/%mm/%dd')
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
thanks for the response i tried with it
Now it is storing NULL
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Try
convert(datetime, @date,103)
|
|
|
|
|
Does anybody guide me how to transfer data from DataTable to Excel
|
|
|
|
|
Try a google search.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Try Using Stream Reader and Writer.......
|
|
|
|
|
you've to iterate through dt row by row
try the following;
---------------------------------------
Respone.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.ContentType="application/.xls";
foreach(dataRow row in dt.Rows)
{
Response.Write(" ");
Response.Write(row[0]+" "+row[1]);
}
Response.End();
-----------------------------------------
customize you code while writting it into Response's Write method, I gave you a fair example, play with it
|
|
|
|
|
|
HI
can any one provide me the list of allowed html tags supported by crystal reports in visual studio 2008 ?, thankx in advance.
|
|
|
|
|
|
How to use HTML Tag in Crystal report.
already html tag is available in my database. i want to use that tag as work in HTML file.
|
|
|
|
|
i tried to load a HTML file using crystal report with the following content
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td>column 1</td>
<td>column 2</td>
<td>column 3</td>
</tr>
<tr>
<td>value 1</td>
<td>value 2</td>
<td>value 3</td>
</tr>
<tr>
<td>value 1</td>
<td>value 2</td>
<td>value 3</td>
</tr>
</table>
but the content was shown without table formatting
How can i get in table format with cellpadding and cellspacing
pls help me
|
|
|
|
|
hi All
I have some global variable and function in cs file of a aspx page
it it possible to write c# code in aspx file to use that variable
................................
means all i need is how to write c# function and variable under a asp tag
|
|
|
|
|
Its confusing are you trying to say inline coding ?
pratik malviya wrote: means all i need is how to write c# function and variable under a asp tag
can you little bit elaborate the question ?
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
|
|
|
|
|
i want to use function which is written in aspx.cs file.
suppose i write a function "public string labeltext()" in aspx.cs file
now in aspx file i want to use that function to assign the text to label1
i heard that it is possible that we can use functions of aspx.cs file in aspx file by the help of <% %> i tried this but getting some error
plese any body can semd me an example of that on pratikmalviya@gmail.com
|
|
|
|