Saturday, March 31, 2012
Table within a Table - spacing
create 3 equal divisions, etc.).
When I want the inner table's edges to correspond exactly with the edges of
the cell, I set the border (top, left, bottom, right) to zero for both the
inner table and outer table. Also padding to 0 and spacing to 0.
But, for some reason, there is still some space between the bottom of the
inner table and the bottom of the containing cell. (Equal to about 20
pixels or so). I can't figure out how to make that space go away!
--Selden McCabeSelden, I recall experiencing something similar. If you're embedding the
tables manually, try removing all the whitespace (spaces, cr's, lf's)
between the inner </table> tag and the hosting </td>.
/// M
"Selden McCabe" <seldenm@.msn.com> wrote in message
news:OejBVjo#EHA.1564@.TK2MSFTNGP09.phx.gbl...
> Sometimes I want to put a table inside a cell of another table (say, to
> create 3 equal divisions, etc.).
> When I want the inner table's edges to correspond exactly with the edges
of
> the cell, I set the border (top, left, bottom, right) to zero for both the
> inner table and outer table. Also padding to 0 and spacing to 0.
> But, for some reason, there is still some space between the bottom of the
> inner table and the bottom of the containing cell. (Equal to about 20
> pixels or so). I can't figure out how to make that space go away!
> --Selden McCabe
>
Thanks for the tip.
I also found this (by trial and error):
In the table style (select table, format\build style), there is a
line-spacing property for text.
Select custom, and set this to 0.
Even though there was no text and no other types of spaces, etc. in the
table, that last row of space went away!
Thanks again, maybe these items will help others...
--Selden
"MWells" <outbound__at_sygnal.com> wrote in message
news:%23Xe$qso%23EHA.1564@.TK2MSFTNGP09.phx.gbl...
> Selden, I recall experiencing something similar. If you're embedding the
> tables manually, try removing all the whitespace (spaces, cr's, lf's)
> between the inner </table> tag and the hosting </td>.
> /// M
> "Selden McCabe" <seldenm@.msn.com> wrote in message
> news:OejBVjo#EHA.1564@.TK2MSFTNGP09.phx.gbl...
> of
>
Thanks Selden, I like your approach better. It's a much cleaner than
hacking all the whitespace from your HTML...
Great work on the research.
/// M
"Selden McCabe" <seldenm@.msn.com> wrote in message
news:ef#g16o#EHA.3372@.TK2MSFTNGP10.phx.gbl...
> Thanks for the tip.
> I also found this (by trial and error):
> In the table style (select table, format\build style), there is a
> line-spacing property for text.
> Select custom, and set this to 0.
> Even though there was no text and no other types of spaces, etc. in the
> table, that last row of space went away!
> Thanks again, maybe these items will help others...
> --Selden
>
> "MWells" <outbound__at_sygnal.com> wrote in message
> news:%23Xe$qso%23EHA.1564@.TK2MSFTNGP09.phx.gbl...
the
edges
the
>
Table within a Table - spacing
create 3 equal divisions, etc.).
When I want the inner table's edges to correspond exactly with the edges of
the cell, I set the border (top, left, bottom, right) to zero for both the
inner table and outer table. Also padding to 0 and spacing to 0.
But, for some reason, there is still some space between the bottom of the
inner table and the bottom of the containing cell. (Equal to about 20
pixels or so). I can't figure out how to make that space go away!
--Selden McCabeSelden, I recall experiencing something similar. If you're embedding the
tables manually, try removing all the whitespace (spaces, cr's, lf's)
between the inner </table> tag and the hosting </td>.
/// M
"Selden McCabe" <seldenm@.msn.com> wrote in message
news:OejBVjo#EHA.1564@.TK2MSFTNGP09.phx.gbl...
> Sometimes I want to put a table inside a cell of another table (say, to
> create 3 equal divisions, etc.).
> When I want the inner table's edges to correspond exactly with the edges
of
> the cell, I set the border (top, left, bottom, right) to zero for both the
> inner table and outer table. Also padding to 0 and spacing to 0.
> But, for some reason, there is still some space between the bottom of the
> inner table and the bottom of the containing cell. (Equal to about 20
> pixels or so). I can't figure out how to make that space go away!
> --Selden McCabe
Thanks for the tip.
I also found this (by trial and error):
In the table style (select table, format\build style), there is a
line-spacing property for text.
Select custom, and set this to 0.
Even though there was no text and no other types of spaces, etc. in the
table, that last row of space went away!
Thanks again, maybe these items will help others...
--Selden
"MWells" <outbound__at_sygnal.com> wrote in message
news:%23Xe$qso%23EHA.1564@.TK2MSFTNGP09.phx.gbl...
> Selden, I recall experiencing something similar. If you're embedding the
> tables manually, try removing all the whitespace (spaces, cr's, lf's)
> between the inner </table> tag and the hosting </td>.
> /// M
> "Selden McCabe" <seldenm@.msn.com> wrote in message
> news:OejBVjo#EHA.1564@.TK2MSFTNGP09.phx.gbl...
>> Sometimes I want to put a table inside a cell of another table (say, to
>> create 3 equal divisions, etc.).
>> When I want the inner table's edges to correspond exactly with the edges
> of
>> the cell, I set the border (top, left, bottom, right) to zero for both
>> the
>> inner table and outer table. Also padding to 0 and spacing to 0.
>>
>> But, for some reason, there is still some space between the bottom of the
>> inner table and the bottom of the containing cell. (Equal to about 20
>> pixels or so). I can't figure out how to make that space go away!
>>
>> --Selden McCabe
>>
>>
Thanks Selden, I like your approach better. It's a much cleaner than
hacking all the whitespace from your HTML...
Great work on the research.
/// M
"Selden McCabe" <seldenm@.msn.com> wrote in message
news:ef#g16o#EHA.3372@.TK2MSFTNGP10.phx.gbl...
> Thanks for the tip.
> I also found this (by trial and error):
> In the table style (select table, format\build style), there is a
> line-spacing property for text.
> Select custom, and set this to 0.
> Even though there was no text and no other types of spaces, etc. in the
> table, that last row of space went away!
> Thanks again, maybe these items will help others...
> --Selden
>
> "MWells" <outbound__at_sygnal.com> wrote in message
> news:%23Xe$qso%23EHA.1564@.TK2MSFTNGP09.phx.gbl...
> > Selden, I recall experiencing something similar. If you're embedding
the
> > tables manually, try removing all the whitespace (spaces, cr's, lf's)
> > between the inner </table> tag and the hosting </td>.
> > /// M
> > "Selden McCabe" <seldenm@.msn.com> wrote in message
> > news:OejBVjo#EHA.1564@.TK2MSFTNGP09.phx.gbl...
> >> Sometimes I want to put a table inside a cell of another table (say, to
> >> create 3 equal divisions, etc.).
> >> When I want the inner table's edges to correspond exactly with the
edges
> > of
> >> the cell, I set the border (top, left, bottom, right) to zero for both
> >> the
> >> inner table and outer table. Also padding to 0 and spacing to 0.
> >>
> >> But, for some reason, there is still some space between the bottom of
the
> >> inner table and the bottom of the containing cell. (Equal to about 20
> >> pixels or so). I can't figure out how to make that space go away!
> >>
> >> --Selden McCabe
> >>
> >>
Wednesday, March 28, 2012
TableCell
TableCell cell = new TableCell()
but I could not find how to add a TextBox inside this cell. Any ideas?
Thanks in advance
Serdar KALAYCI
--WebControls.TextBox txt = new WebControls.TextBox();
cell.Controls.Add(txt);
Karl
"Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
news:ewP%23cXwPDHA.4024@.tk2msftngp13.phx.gbl...
> I create a TableCell by
> TableCell cell = new TableCell()
> but I could not find how to add a TextBox inside this cell. Any ideas?
> Thanks in advance
> Serdar KALAYCI
> --
Got it, here's the code if anyone wonders...
TableCell cell = new TableCell();
TextBox text1 = new TextBox();
cell.Controls.Add (text1);
"Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
news:ewP#cXwPDHA.4024@.tk2msftngp13.phx.gbl...
> I create a TableCell by
> TableCell cell = new TableCell()
> but I could not find how to add a TextBox inside this cell. Any ideas?
> Thanks in advance
> Serdar KALAYCI
> --
I have one more question. I added a Button inside a Table at design time by
changing HTML codes, but I can't access it's events or even see it in the
components list on the Properties window.
Serdar KALAYCI
"Karl Seguin" <kseguin##crea.ca> wrote in message
news:uO53SbwPDHA.1608@.TK2MSFTNGP11.phx.gbl...
> WebControls.TextBox txt = new WebControls.TextBox();
> cell.Controls.Add(txt);
> Karl
>
> "Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
> news:ewP%23cXwPDHA.4024@.tk2msftngp13.phx.gbl...
> > I create a TableCell by
> > TableCell cell = new TableCell()
> > but I could not find how to add a TextBox inside this cell. Any ideas?
> > Thanks in advance
> > Serdar KALAYCI
> > --
if you are adding an object programatically, like your butotn, you'll also
have to attach the event programatically.
in vb.net, you can use:
addhandler yourButton.click, AddressOf yourFunctionHandler
in c#, you can use:
yourButton.Click += new EventHandler(yourFunctionHandler);
Make sure that your button is created, and you attach your handler on
postback also (ie, don't wrap it in an !page.IsPostback)
Karl
"Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
news:ulgu2oxPDHA.1748@.TK2MSFTNGP11.phx.gbl...
> I have one more question. I added a Button inside a Table at design time
by
> changing HTML codes, but I can't access it's events or even see it in the
> components list on the Properties window.
> Serdar KALAYCI
>
> "Karl Seguin" <kseguin##crea.ca> wrote in message
> news:uO53SbwPDHA.1608@.TK2MSFTNGP11.phx.gbl...
> > WebControls.TextBox txt = new WebControls.TextBox();
> > cell.Controls.Add(txt);
> > Karl
> > "Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
> > news:ewP%23cXwPDHA.4024@.tk2msftngp13.phx.gbl...
> > > I create a TableCell by
> > > > TableCell cell = new TableCell()
> > > > but I could not find how to add a TextBox inside this cell. Any ideas?
> > > > Thanks in advance
> > > Serdar KALAYCI
> > > --
> > >
Monday, March 26, 2012
Tables inside of forms?
Such as:
<form>
<Table>
<Tr><Td>Company:</Td><Td>TextBoxCompany</Td></Tr>
</Table>
</form
I can not seem to get an insert command to write to the database if I place the text boxes for input in the cells of a table. If I do the same form without the table the insert command works just fine.
What am I missing? Is there a better way to build data collection forms?
Thanks in advance for helping!
Scottyou can use any html you want inside the form.
what error are you taling about, could you be more specific?
Can you show us the textbox declaration and the update code.
Simon
Thanks for responding Christian.
Since I posted I have build a simple form, tested it and then moved the input boxes into a form. And that works as it should.
The project collects employment data for association work. In testing, the application tells me that the post is sucessful, but the record is not written to the database. Because others will use the data in Excel I am using Access 2000.
Here is the code:
Sub ButtonSubmit_Click(sender As Object, e As EventArgs)
Dim Company = Server.HtmlEncode(TextCompany.Text)
Dim FacilityName = Server.HtmlEncode(TextFacilityName.Text)
Dim Address = Server.HtmlEncode(TextAddress.Text)
Dim City = Server.HtmlEncode(TextCity.Text)
Dim State = (DropDownListState.SelectedItem.Value)
Dim FacilityZip = Server.HtmlEncode(TextFacilityZip.Text)
Dim NumberEmployees = Server.HtmlEncode(TextNumberEmployees.Text)
Dim Zip1 = Server.HtmlEncode(TextZip1.Text)
Dim Zip2 = Server.HtmlEncode(TextZip2.Text)
Dim Zip3 = Server.HtmlEncode(TextZip3.Text)
Dim Zip4 = Server.HtmlEncode(TextZip4.Text)
Dim Zip5 = Server.HtmlEncode(TextZip5.Text)
Dim Zip6 = Server.HtmlEncode(TextZip6.Text)
Dim PropertyTaxes = Server.HtmlEncode(TextPropertyTaxes.Text)
Dim WithholdingTaxState = Server.HtmlEncode(TextWithholdingTaxState.Text)
Dim WithholdingTaxFederal = Server.HtmlEncode(TextWithholdingTaxFederal.Text)
Dim CharitableContribution = Server.HtmlEncode(TextCharitableContribution.Text)
Dim UserName = Server.HtmlEncode(TextCharitableContribution.Text)
Dim Pwd = Server.HtmlEncode(TextPassword.Text)
Dim Timestamp As DateTime
Timestamp = Now
InsertRecord(Company, FacilityName, Address, City, State, FacilityZip, _
NumberEmployees, Zip1, Zip2, Zip3, Zip4, Zip5, Zip6, PropertyTaxes, _
WithholdingTaxState, WithholdingTaxFederal, CharitableContribution, _
UserName, Pwd, Timestamp)
End Sub
Function InsertRecord( _
ByVal company As String, _
ByVal facilityName As String, _
ByVal address As String, _
ByVal city As String, _
ByVal state As String, _
ByVal facilityZip As String, _
ByVal numberEmployees As String, _
ByVal zip1 As String, _
ByVal zip2 As String, _
ByVal zip3 As String, _
ByVal zip4 As String, _
ByVal zip5 As String, _
ByVal zip6 As String, _
ByVal propertyTaxes As String, _
ByVal withholdingTaxState As String, _
ByVal withholdingTaxFederal As String, _
ByVal charitableContribution As String, _
ByVal userName As String, _
ByVal pwd As String, _
ByVal timestamp As Date) As Integer
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\Inetpub\wwwr"& _
"oot\Bifma\data\data.mdb"
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = "INSERT INTO [data] ([Company], [FacilityName], [Address], [City], [State], [Facil"& _
"ityZip], [NumberEmployees], [Zip1], [Zip2], [Zip3], [Zip4], [Zip5], [Zip6], [Pro"& _
"pertyTaxes], [WithholdingTaxState], [WithholdingTaxFederal], [CharitableContribu"& _
"tion], [UserName], [Pwd], [Timestamp]) VALUES (@.Company, @.FacilityName, @.Address"& _
", @.City, @.State, @.FacilityZip, @.NumberEmployees, @.Zip1, @.Zip2, @.Zip3, @.Zip4, @.Zi"& _
"p5, @.Zip6, @.PropertyTaxes, @.WithholdingTaxState, @.WithholdingTaxFederal, @.Charit"& _
"ableContribution, @.UserName, @.Pwd, @.Timestamp)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_company As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_company.ParameterName = "@.Company"
dbParam_company.Value = company
dbParam_company.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_company)
Dim dbParam_facilityName As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_facilityName.ParameterName = "@.FacilityName"
dbParam_facilityName.Value = facilityName
dbParam_facilityName.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_facilityName)
Dim dbParam_address As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_address.ParameterName = "@.Address"
dbParam_address.Value = address
dbParam_address.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_address)
Dim dbParam_city As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_city.ParameterName = "@.City"
dbParam_city.Value = city
dbParam_city.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_city)
Dim dbParam_state As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_state.ParameterName = "@.State"
dbParam_state.Value = state
dbParam_state.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_state)
Dim dbParam_facilityZip As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_facilityZip.ParameterName = "@.FacilityZip"
dbParam_facilityZip.Value = facilityZip
dbParam_facilityZip.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_facilityZip)
Dim dbParam_numberEmployees As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_numberEmployees.ParameterName = "@.NumberEmployees"
dbParam_numberEmployees.Value = numberEmployees
dbParam_numberEmployees.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_numberEmployees)
Dim dbParam_zip1 As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_zip1.ParameterName = "@.Zip1"
dbParam_zip1.Value = zip1
dbParam_zip1.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_zip1)
Dim dbParam_zip2 As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_zip2.ParameterName = "@.Zip2"
dbParam_zip2.Value = zip2
dbParam_zip2.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_zip2)
Dim dbParam_zip3 As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_zip3.ParameterName = "@.Zip3"
dbParam_zip3.Value = zip3
dbParam_zip3.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_zip3)
Dim dbParam_zip4 As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_zip4.ParameterName = "@.Zip4"
dbParam_zip4.Value = zip4
dbParam_zip4.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_zip4)
Dim dbParam_zip5 As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_zip5.ParameterName = "@.Zip5"
dbParam_zip5.Value = zip5
dbParam_zip5.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_zip5)
Dim dbParam_zip6 As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_zip6.ParameterName = "@.Zip6"
dbParam_zip6.Value = zip6
dbParam_zip6.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_zip6)
Dim dbParam_propertyTaxes As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_propertyTaxes.ParameterName = "@.PropertyTaxes"
dbParam_propertyTaxes.Value = propertyTaxes
dbParam_propertyTaxes.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_propertyTaxes)
Dim dbParam_withholdingTaxState As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_withholdingTaxState.ParameterName = "@.WithholdingTaxState"
dbParam_withholdingTaxState.Value = withholdingTaxState
dbParam_withholdingTaxState.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_withholdingTaxState)
Dim dbParam_withholdingTaxFederal As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_withholdingTaxFederal.ParameterName = "@.WithholdingTaxFederal"
dbParam_withholdingTaxFederal.Value = withholdingTaxFederal
dbParam_withholdingTaxFederal.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_withholdingTaxFederal)
Dim dbParam_charitableContribution As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_charitableContribution.ParameterName = "@.CharitableContribution"
dbParam_charitableContribution.Value = charitableContribution
dbParam_charitableContribution.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_charitableContribution)
Dim dbParam_userName As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_userName.ParameterName = "@.UserName"
dbParam_userName.Value = userName
dbParam_userName.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_userName)
Dim dbParam_pwd As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_pwd.ParameterName = "@.Pwd"
dbParam_pwd.Value = pwd
dbParam_pwd.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_pwd)
Dim dbParam_timestamp As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_timestamp.ParameterName = "@.Timestamp"
dbParam_timestamp.Value = timestamp
dbParam_timestamp.DbType = System.Data.DbType.DateTime
dbCommand.Parameters.Add(dbParam_timestamp)
Dim rowsAffected As Integer = 0
dbConnection.Open
Try
rowsAffected = dbCommand.ExecuteNonQuery
LabelConfirmation.Text = "Thank you! Your data entry was sucessful."
'ButtonSubmit.Enabled = False
Catch
LabelConfirmation.Text = "Sorry there was a problem with your entry. Please Contact Brad or Mike"
'
Finally
dbConnection.Close
End Try
Return rowsAffected
End Function
Thank You for helping.
Scott
Fixed. Appears I had tried to use the reservered word "Timpstamp" as DateTime = Now.
Thursday, March 22, 2012
Tags inside value field of appsettings in web.config
it looks likes this
<configuration>
<appSettings>
<add key="MyXmlData" value="<data><type></type>......." />
</appSettings>
</configuration
but i get an error message
some one help meYou need to encode/escape the characters. You can do it manually if you
know all of the rules, but I wrote a little utility for myself that I
know will do it right. I guess I should post the full app at some point,
but the relevant method is:
public string Encode(string input)
{
StringBuilder output = new StringBuilder();
using (StringWriter stringWriter = new StringWriter(output,
CultureInfo.InvariantCulture))
{
XmlTextWriter xmlWriter = new XmlTextWriter(stringWriter);
xmlWriter.WriteStartElement("element");
xmlWriter.WriteAttributeString("attribute", input);
xmlWriter.WriteEndElement();
xmlWriter.Close();
}
return output.ToString();
}
Just create a simple WinForms app with a textbox to past a value into, a
button that runs the Encode method, and then a textbox for the output
(not label - you want to be able to select the output for copy/paste).
Joshua Flanagan
http://flimflan.com/blog
Tags inside value field of appsettings in web.config
it looks likes this
<configuration>
<appSettings>
<add key="MyXmlData" value="<data><type></type>......." />
</appSettings>
</configuration>
but i get an error message
some one help meYou need to encode/escape the characters. You can do it manually if you
know all of the rules, but I wrote a little utility for myself that I
know will do it right. I guess I should post the full app at some point,
but the relevant method is:
public string Encode(string input)
{
StringBuilder output = new StringBuilder();
using (StringWriter stringWriter = new StringWriter(output,
CultureInfo.InvariantCulture))
{
XmlTextWriter xmlWriter = new XmlTextWriter(stringWriter);
xmlWriter.WriteStartElement("element");
xmlWriter.WriteAttributeString("attribute", input);
xmlWriter.WriteEndElement();
xmlWriter.Close();
}
return output.ToString();
}
Just create a simple WinForms app with a textbox to past a value into, a
button that runs the Encode method, and then a textbox for the output
(not label - you want to be able to select the output for copy/paste).
Joshua Flanagan
http://flimflan.com/blog