Click here to Skip to main content
15,890,438 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Permission Denied between ASP & ASP.Net Frames Pin
SteveRicketts6-Jul-08 10:28
SteveRicketts6-Jul-08 10:28 
QuestionContinue Pin
kjosh6-Jul-08 4:55
kjosh6-Jul-08 4:55 
AnswerRe: Continue Pin
Parwej Ahamad6-Jul-08 7:11
professionalParwej Ahamad6-Jul-08 7:11 
Questionpic in database Pin
strawberrysh6-Jul-08 3:59
strawberrysh6-Jul-08 3:59 
AnswerRe: pic in database Pin
N a v a n e e t h6-Jul-08 4:13
N a v a n e e t h6-Jul-08 4:13 
QuestionRe: pic in database Pin
strawberrysh6-Jul-08 6:47
strawberrysh6-Jul-08 6:47 
AnswerRe: pic in database Pin
merinkmathew8-Jul-08 7:12
merinkmathew8-Jul-08 7:12 
QuestionJoin tables in sqldatasource Pin
saquibsa6-Jul-08 2:03
saquibsa6-Jul-08 2:03 
Hi, i have formview control in my page and on that i have two textboxes and button in it which display at runtime. i declare the button event in my aspx.vb

Protected Sub insertbutton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsValid Then Exit Sub

' Determine the currently logged on user's UserId
Dim currentUser As MembershipUser = Membership.GetUser()
Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid)

Dim connectionString As String = ConfigurationManager.ConnectionStrings("SecurityTutorialsConnectionString").ConnectionString
Dim insertSql As String = "INSERT INTO Reply(Subjects, Bodi, CommentDates UserId) VALUES(@Gameid, @Subjects, @Bodi, @CommentDates, @UserId)"

Using myConnection As New SqlConnection(connectionString)
myConnection.Open()

Dim myCommand As New SqlCommand(insertSql, myConnection)
myCommand.Parameters.AddWithValue("@Subject", subject1.Text.Trim())
myCommand.Parameters.AddWithValue("@message", message.Text.Trim())
myCommand.Parameters.AddWithValue("@CommentDates", DateTime.Now())
myCommand.Parameters.AddWithValue("@UserId", currentUserId)
myCommand.ExecuteNonQuery()
Label2.Text = "Your Comment has Been Added to our Database. Thank You"
myConnection.Close()
End Using

End Sub

and the button property

<asp:button id="Button1" runat="server" text="post" causesvalidation="true" onclick="insertbutton_Click" xmlns:asp="#unknown">

but when i click on button it shows the error like this.


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: BC30451: Name 'subject1' is not declared.

Source Error:


Line 39:
Line 40: Dim myCommand As New SqlCommand(insertSql, myConnection)
Line 41: myCommand.Parameters.AddWithValue("@Subject", subject1.Text.Trim())
Line 42: myCommand.Parameters.AddWithValue("@message", message.Text.Trim())
Line 43: myCommand.Parameters.AddWithValue("@CommentDates", DateTime.Now())

i place the following in my onload event

Dim drp As Label
drp = form1.FindControl("Label2")


Dim erp As TextBox
erp = form1.FindControl("subject1")


Dim crp As TextBox
crp = form1.FindControl("message")

but the object not handled at runtime.

Please help me to solve this.

Thank you

saquib

AnswerRe: Join tables in sqldatasource Pin
Herman<T>.Instance8-Jul-08 4:00
Herman<T>.Instance8-Jul-08 4:00 
Questionobject not declared at runtime Pin
saquibsa6-Jul-08 2:02
saquibsa6-Jul-08 2:02 
GeneralRe: object not declared at runtime Pin
Guffa6-Jul-08 3:21
Guffa6-Jul-08 3:21 
QuestionOpenFileDialog Pin
two_man_only6-Jul-08 1:53
two_man_only6-Jul-08 1:53 
AnswerRe: OpenFileDialog Pin
Steve Westbrook6-Jul-08 16:01
Steve Westbrook6-Jul-08 16:01 
GeneralRe: OpenFileDialog Pin
two_man_only6-Jul-08 19:27
two_man_only6-Jul-08 19:27 
GeneralRe: OpenFileDialog Pin
Steve Westbrook7-Jul-08 1:42
Steve Westbrook7-Jul-08 1:42 
Questionhow to call a javascript function from javascript file in asp.net 2.0 Pin
vijaylumar5-Jul-08 20:21
vijaylumar5-Jul-08 20:21 
AnswerRe: how to call a javascript function from javascript file in asp.net 2.0 Pin
N a v a n e e t h6-Jul-08 3:08
N a v a n e e t h6-Jul-08 3:08 
Questiontimer in wepage Pin
Panks_macho5-Jul-08 20:20
Panks_macho5-Jul-08 20:20 
AnswerRe: timer in wepage Pin
N a v a n e e t h6-Jul-08 3:12
N a v a n e e t h6-Jul-08 3:12 
Questionprint problem Pin
lav naphade5-Jul-08 18:51
lav naphade5-Jul-08 18:51 
QuestionAccessdatasource control help plzz Pin
dream_liner_7e75-Jul-08 17:21
dream_liner_7e75-Jul-08 17:21 
AnswerRe: Accessdatasource control help plzz Pin
N a v a n e e t h5-Jul-08 18:10
N a v a n e e t h5-Jul-08 18:10 
QuestionAccessdatasource control help Pin
dream_liner_7e75-Jul-08 16:25
dream_liner_7e75-Jul-08 16:25 
AnswerRe: Accessdatasource control help Pin
N a v a n e e t h5-Jul-08 16:42
N a v a n e e t h5-Jul-08 16:42 
QuestionIssues with sorting a dynamically created Gridview Pin
AaronM_NZ5-Jul-08 16:07
AaronM_NZ5-Jul-08 16:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.