Showing posts with label language. Show all posts
Showing posts with label language. Show all posts

Saturday, March 31, 2012

table1_onclick generated without javascript function

Hi,

I have a website in dotnet2.0 with a masterpage.

Here is my code of page wich use the masterpage :

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false" CodeFile="WfSelectExp.aspx.vb" Inherits="WebForm_WfSelectExp" MasterPageFile="~/MasterPage.master" Title="Appolo" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %><asp:Content ID="ContentSelectBL" ContentPlaceHolderID="ContentPlaceHolderCentral" runat="Server"> <table border="0" cellpadding="0" cellspacing="0" class="TABLE" width="100%"> <tr> <td colspan="2" style="height: 10px; width: 5px;"></td> </tr> <tr> <td style="width: 5px;"></td> <td align="center"> <table id="Table" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><!-- table presentation -->

And IIS will generated a page with the following code :

 <table id="TABLE1" border="0" cellpadding="0" cellspacing="0" class="TABLE" onload="javascript:CloseFenAttente()" style="height: 87%" width="100%" onclick="return TABLE1_onclick()"> <tr> <td colspan="5" style="height: 5px; width: 5px;"> <input type="hidden" name="ctl00$ContentPlaceHolderCentral$HiddenFieldPoidsTotal" id="ctl00_ContentPlaceHolderCentral_HiddenFieldPoidsTotal" value="0" /> <input type="hidden" name="ctl00$ContentPlaceHolderCentral$HiddenFieldQuantCommPAL" id="ctl00_ContentPlaceHolderCentral_HiddenFieldQuantCommPAL" value="0" /> <input type="hidden" name="ctl00$ContentPlaceHolderCentral$HiddenFieldQuantExpPAL" id="ctl00_ContentPlaceHolderCentral_HiddenFieldQuantExpPAL" value="0" /> <input type="hidden" name="ctl00$ContentPlaceHolderCentral$HiddenFieldQuantCommUL" id="ctl00_ContentPlaceHolderCentral_HiddenFieldQuantCommUL" value="0" /> <input type="hidden" name="ctl00$ContentPlaceHolderCentral$HiddenFieldQuantExpUL" id="ctl00_ContentPlaceHolderCentral_HiddenFieldQuantExpUL" value="0" /> <input type="hidden" name="ctl00$ContentPlaceHolderCentral$HiddenFieldRetour" id="ctl00_ContentPlaceHolderCentral_HiddenFieldRetour" value="0" /> </td> </tr> <tr> <td style="width: 10px; height: 59px;"></td> <td align="center" colspan="3" style="height: 59px"><!-- Table presentation -->

And as you can see you have a Table1.onclick() whereas no function is create before.

I have a lot of code around so I can not post all the page else I have to post all the website..

But it seems to be a bug in dotnet 2.0

I have search on google and found few people with the same issue, someone know more about this?

Or have a solution to this?

thanks,

I have the same problem.....

need help!!!!!!! AJAX applications are useless if very time it raises an error,isn't it?

Thursday, March 22, 2012

Tags missing there end tags when they are there.

Ok I've got this real pain in the butt problem, I have copied and pasted much of my code from a template and I understand html, css, VB language pritty good, I have used my current page without problems using Visual Web Developer 2005 Express Edition for some time now....but today I've moved around a few tags located in a couple div tags and now when I try to switch to the design view from the code view a couple error's come up and tell me that 4 of my div tags are missing there end tags and 4 of my end tags are missing there div tags.........but they are all there, its just not reconizing them......how do I bind the end tag to the start tag when this happens, I've tried re-writing this bit of code which works but the next time I go into my code view and back to the design view the same error comes up...

Talk about a pain any help would be of great help...thank you.......also I know that somehow you can click a couple buttons to automaticlly arrange your code into the right format for instance this horrible messy code here

 "LoginView2" runat="server"> Welcome Back
"LoginName1" runat="server" style="left: 1px; top: 15px; z-index: 100;" Height="23px" /> "LoginStatus1" runat="server" Style="position: static" />
To this somewhat nicer code here.
 <asp:LoginView ID="LoginView2" runat="server"> <LoggedInTemplate> Welcome Back<br /> <asp:LoginName ID="LoginName1" runat="server" style="left: 1px; top: 15px; z-index: 100;" Height="23px" />    <asp:LoginStatus ID="LoginStatus1" runat="server" Style="position: static" /> </LoggedInTemplate> <AnonymousTemplate> <asp:Login ID="Login1" runat="server" BackColor="Bisque" BorderColor="#FF8000" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Bold="True" Font-Names="Palatino Linotype" Font-Size="1.3em" ForeColor="Black" Height="135px" Style="position: static" CreateUserText="Register" CreateUserUrl="~/Register.aspx" PasswordRecoveryText="Forgot Your Password?" PasswordRecoveryUrl="~/passwordRecovery.aspx"> <TitleTextStyle BackColor="#FF8000" Font-Bold="True" Font-Size="0.9em" ForeColor="White" /> <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> <TextBoxStyle Font-Size="0.8em" /> <LoginButtonStyle BackColor="#FF8000" BorderColor="#FF8000" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="White" /> <CheckBoxStyle BackColor="Transparent" /> <HyperLinkStyle ForeColor="RoyalBlue" /> </asp:Login> </AnonymousTemplate> </asp:LoginView>
if you know they way to do this please let me know that might be my problem things not lining up...

P.S. my code does not look like the first example LOL

Sorry everyone I just figured this whole thing out after working on it literally for the past 5 hours haha but if you want to learn about this problem and how to incorporate <form runat=server> Tags in a masterpage and use content pages that also run off that tag then go to my very last post located here.

http://forums.asp.net/thread/1379460.aspx

Thanks.

taking text from a drop down list and want to insert into a database


<%@dotnet.itags.org. Page Language="VB" Debug="true" %>
<%@dotnet.itags.org. import Namespace="System.Data" %>
<%@dotnet.itags.org. import Namespace="System.Data.OleDb" %>
<script runat="server"
dim Conn as new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\admin\Desktop\Reminder\dbReminder.mdb")

Sub btnSet_Click(obj as Object, e as EventArgs)

dim objTrans as OleDbTransaction
dim objCmd as OleDbcommand = new OleDbcommand ("INSERT INTO tblReminder (mobile, station, reminder, time) VALUES (@dotnet.itags.org.MOBILE, @dotnet.itags.org.STATION, @dotnet.itags.org.REMINDER, @dotnet.itags.org.TIME)", Conn)
dim objParam as OleDbParameter

objParam = objCmd.Parameters.Add("@dotnet.itags.org.MOBILE", oleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = lblUser.Text

objParam = objCmd.Parameters.Add("@dotnet.itags.org.STATION", oleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = lblStation.Text

objParam = objCmd.Parameters.Add("@dotnet.itags.org.REMINDER", oleDbType.Char)
objParam.Direction = ParameterDirection.Input
objParam.Value = DDLFields.SelectedItem.Text

objParam = objCmd.Parameters.Add("@dotnet.itags.org.TIME", oleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbTime.Text

Conn.Open()

objTrans = Conn.BeginTransaction()
objCmd.Transaction = objTrans

try
objCmd.executeNonQuery
objTrans.commit()
catch ex as OleDbException
objTrans.RollBack()
lblError.Text = "Error inserting reminder into database"
end try

objcmd.Connection.Close()
End sub

Private Sub Page_Load(sender As Object, e As System.EventArgs)
If Not Page.IsPostBack Then

dim Conn as new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\admin\Desktop\Reminder\dbReminder.mdb")
dim objTrans as OleDbTransaction
dim objCmd as OleDbcommand = New OleDbCommand("SELECT time + ' ' + programme as fieldone FROM tblRTE ", Conn)
Conn.Open()

DDLFields.DataSource = objCmd.ExecuteReader()

DDLFields.DataTextField = "fieldone"
DDLFields.DataValueField = "fieldone"
DDLFields.DataBind()

Conn.Close()
End If

If Not Request.Cookies("rm_user") Is Nothing Then
lblUser.Text = Request.Cookies("rm_user").Value
end if
End Sub

</script>

This is the code im using to take the information from the form and enter it into the database.
But it displays my error message every time...
Is it correct?
The part im not sure about is this:

objParam = objCmd.Parameters.Add("@dotnet.itags.org.REMINDER", oleDbType.Char)
objParam.Direction = ParameterDirection.Input
objParam.Value = DDLFields.SelectedItem.Text

Is this the correct way of taking the selected items text from the ddl?

Thanks.Your code looks good, however your SQL looks dodgy. Thisthread in the DevShed forum should help.
I do somthing similar on a page. I think your problem is that the code for the DDL is in the on postback block. When the page is posted back ( user chose something and clicked button to do save) the ddl is not populated.
Try taking the DDL code out of the is postback IF block...


Private Sub Page_Load(sender As Object, e As System.EventArgs)

If Not Page.IsPostBack Then
End If

dim Conn as new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\admin\Desktop\Reminder\dbReminder.mdb")

dim objTrans as OleDbTransaction

dim objCmd as OleDbcommand = New OleDbCommand("SELECT time + ' ' + programme as fieldone FROM tblRTE ", Conn)

Conn.Open()

DDLFields.DataSource = objCmd.ExecuteReader()

DDLFields.DataTextField = "fieldone"

DDLFields.DataValueField = "fieldone"

DDLFields.DataBind()

Conn.Close()

If Not Request.Cookies("rm_user") Is Nothing Then

lblUser.Text = Request.Cookies("rm_user").Value

end if

End Sub

also, I don't think you need the transaction stuff. Transactions are used for multiple DB actions. not a single action. The try block should suffice. If the single DB action fails ( your insert) there are no other actions to rollback.
Hope that helps
> I think your problem is that the code for the DDL is in the on postback block. When the
> page is posted back ( user chose something and clicked button to do save) the ddl is not
> populated. Try taking the DDL code out of the is postback IF block...

This is not the problem. The DDL is repopulated via ViewState on PostBack.

I do agree about the Transaction.

One thing that would help solve this is for emmettd to post the error message.
I talking about the error message in my code.

its "Error inserting reminder into database"

its in the code, in the btnSet_click, near the end.
change this line and let us know what you get

lblError.Text =ex.tostring()