<asp:HyperLink NavigateUrl='<%# "SomePage.aspx?someparam=" + DataBinder.Eval(Container, "DataItem.PropertyID") %>' runat="server" />
Tech Tidbits - Ruby, Ruby On Rails, Merb, .Net, Javascript, jQuery, Ajax, CSS...and other random bits and pieces.
Sunday, December 30, 2007
How to pass variables thru a DataGrid hyperlink column
Wednesday, December 19, 2007
Ruby Blog
I've decided to create a Ruby only blog, though I'll keep cross posting here for now...who knows, I may change my mind and just keep the one blog here...
spariamsgems
spariamsgems
Viewing .CHM files on Mac OS X - Chmox
I tried several Mac options and had no luck (xchm froze, libchmxx has a utility called chmdissect - it worked, but no images)...finally, I struck gold with Chmox.
1) Install CHMLIB - http://www.jedrea.com/chmlib/
2) Install Chmox - http://chmox.sourceforge.net/
The binary is a standard dmg file...click on the dmg file and move the application over to your application directory.
1) Install CHMLIB - http://www.jedrea.com/chmlib/
% ./configure
% make
% sudo make install
2) Install Chmox - http://chmox.sourceforge.net/
The binary is a standard dmg file...click on the dmg file and move the application over to your application directory.
Monday, December 10, 2007
Sending E-mail with Ruby Net::SMTP
All you need to know is here:
http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/classes/Net/SMTP.html
Or if your mail server is on another machine:
For example:
http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/classes/Net/SMTP.html
def send_email(from, from_alias, to, to_alias, subject, message)
msg = <<EOF
From: #{from_alias} <#{from}>
To: #{to_alias} <#{to}>
Subject: #{subject}
#{message}
EOF
Net::SMTP.start('localhost') do |smtp|
smtp.send_message(msg, from, to)
end
end
Or if your mail server is on another machine:
Net::SMTP.start(mail_server, port, helo_domain) do |smtp|
smtp.send_message msg, from, to
end
For example:
smtp.send_message('your.smtp.server', 25, 'mail.from.domain')
Wednesday, November 21, 2007
ASP.NET Calendar Control - Misc
How to: Display Selected Dates from a Database in the Calendar Control
Hide days that aren't in current month:
Disable link for particular day (the 23rd, in this case):
Hide days that aren't in current month:
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date.Month != Calendar1.VisibleDate.Month)
e.Cell.Text = "";
}
Disable link for particular day (the 23rd, in this case):
protected void cal_DayRender(object source, DayRenderEventArgs e)
{
if (e.Day.Date.Day == 23)
{
e.Cell.Controls.Clear();
e.Cell.Text = e.Day.DayNumberText;
e.Cell.BackColor = System.Drawing.Color.Gainsboro;
}
}
Tuesday, November 20, 2007
ASP.NET HyperLink Control: mailto link
<asp:HyperLink ID="EmailLink" text='<%# Eval("UserEmail") %>' NavigateUrl='<%# Eval("UserEmail","mailto:{0}")%>' runat="server" target="_blank" />
With a "Subject"
<asp:HyperLink ID="EmailLink" text='<%# Eval("UserEmail") %>' NavigateUrl='<%# Eval("UserEmail","mailto:{0}?Subject=YourQuestion")%>' runat="server" target="_blank" />
Saturday, November 17, 2007
Identify Button Clicked in GridView
I had a GridView with a ButtonField used to Select a record to display a User's details in a DetailsView. I wanted a second button to display different form for changing a Users's password, since I wanted that to be a separate option.
GridView (usersGrid):
Code Behind:
GridView (usersGrid):
<asp:ButtonField CommandName="Select" Text="Select" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton runat="server" ID="changePasswordButton" Text="Change Password" OnClick="usersGrid_SelectRow" />
</ItemTemplate>
</asp:TemplateFild>
Code Behind:
protected void usersGrid_SelectRow(object sender, EventArgs e)
{
GridViewRow row = (GridViewRow)((LinkButton)sender).Parent.Parent;
usersGrid.SelectedIndex = row.RowIndex;
MyDatabase.DBUtil = new MyDatabase.DBUtil();
changePasswordDetails.DataSource = DB.GetUser(Int16.Parse(usersGrid.SelectedValue.ToString());
changePasswordDetails.ChangeMode(DetailsViewMode.ReadOnly);
userDeatils.Visible = false;
changePasswordDetails.Visible = true;
changePasswordDetails.DataKeyNames = new string[] { "UserID" };
changePasswordDetails.DataBind();
}
Subscribe to:
Posts (Atom)
About Me
- Doug Sparling
- Developer (Ruby on Rails, iOS), musician/composer, Buddhist, HSP, Vegan, Aspie.
Labels
- .NET (8)
- accordion (1)
- ActiveRecord (1)
- ajax (2)
- APT (1)
- apt-get (1)
- ASP (1)
- ASP.NET .NET (5)
- Audio (1)
- aws (1)
- Bash (1)
- bdd (1)
- C# (1)
- cache_fu (1)
- caching (1)
- DocBook (1)
- DOM (1)
- Eclipse (1)
- Excel (1)
- Firefox (1)
- gem (5)
- Gems (5)
- git (1)
- GridView (2)
- Hibernate (1)
- iBATIS (1)
- Java (9)
- javascript (9)
- javascript css (1)
- jQuery (4)
- jsspec (1)
- mdb2 (2)
- Merb (2)
- mongrel (2)
- mp3 (2)
- Music (2)
- MySQL (2)
- nginx (1)
- openssl (1)
- osx (3)
- pdocast (1)
- pear (2)
- Perl (7)
- php (5)
- plugin (2)
- podcast (1)
- prototype (1)
- REST (1)
- RMagick MacOSX (1)
- rspec (1)
- ruby (14)
- ruby on rails (21)
- RubyGems Merb (1)
- s3 (1)
- screencasts (1)
- scriptaculous (1)
- scriptrunner ruby rails erlang (1)
- Sortable (1)
- subversion (1)
- testing (1)
- testing erlang tsung (1)
- tomcat (1)
- ubuntu (2)
- WebSphere (1)
- will_paginate (1)