Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 22nd, 2010, 05:56 AM
Authorized User
 
Join Date: Jun 2010
Location: Sneek, Netherlands
Posts: 24
Thanks: 10
Thanked 0 Times in 0 Posts
Default Attachments work!!! new problem...

Hey Imar and everybody,

Including attachments to my mail being sent from my site works, super, thanks for that...

But I have a new problem:

I have built a page with an application form, which can be filled in by possible candidates; everything works except for the following:

I want the page/control(.ascx) to 'hold' the values for that specific vacancy, which I managed to do by adding a formView, connected to a SQLdatasource, which is connected to the queryString in the URL. So I get the name of the function and the branch(filiaal) of that specific vacancy on my page, but how do I get this in my email, which is about to be sent from my site?

mailbody=mailbody.replace("###vacatureFiliaal###", vacatureFiliaal.selectedValue) doesn't work...

this solution is propable 'te kort door de bocht'

I used a formView because I cannot figure out how to get data into a TextBox(.text) control

Bertus
Reply With Quote
  #2 (permalink)  
Old September 22nd, 2010, 06:22 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
this solution is propable 'te kort door de bocht'
And so is the question.... ;-)

Without relevant code, it's pretty much impossible to say what's going on. For example, it's unclear what vacatureFiliaal is.

Quote:
I cannot figure out how to get data into a TextBox(.text) control
Assign its Text proeprty:

myTextBox.Text = "SomeText"

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old September 22nd, 2010, 07:17 AM
Authorized User
 
Join Date: Jun 2010
Location: Sneek, Netherlands
Posts: 24
Thanks: 10
Thanked 0 Times in 0 Posts
Default

You asked for it...

workflow:

I have a page displaying all the details of a certain 'vacature'. The detailsView on that page contains a 'Solliciteer!' hyperlinkField. in the URL this hyperlink generates I also included a query string '?Id={0}' where Id is the Id of the 'vacature'.

Once clicked, people get 'sent' to the 'sollicitatie' page for which I built a (.ascx) control.Most of the fields in this control are textfields and fileUpload fields, which all work.

The only problem I have is that I want to add automatically the 'filiaal' value to the 'sollicitatie' email

In my possible solution (which doesn't work by the way) I used a FormView named 'vacatureFiliaal' to display the 'filiaal' value of that specific 'vacature'

this displaying the 'filiaal'value actually works, but if I want to include this value in an e-mail by:
Code:
            mailBody = mailBody.Replace("###VacatureFiliaal###", VacatureFiliaal.SelectedValue)
following your example in chapter 9, page 325, I won't get the 'filiaal' value in the email.

the following code shows you where I create the 'vacatureFiliaal' formView.

Code:
    <asp:FormView ID="VacatureFiliaal" runat="server" DataSourceID="SqlDataSource2" 
                style="font-weight: 700; font-size: large">
                <EditItemTemplate>
                    Filiaal:
                    <asp:TextBox ID="FiliaalTextBox" runat="server" Text='<%# Bind("Filiaal") %>' />
                    <br />
                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Update" />
                    &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                </EditItemTemplate>
                <InsertItemTemplate>
                    Filiaal:
                    <asp:TextBox ID="FiliaalTextBox" runat="server" Text='<%# Bind("Filiaal") %>' />
                    <br />
                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                        CommandName="Insert" Text="Insert" />
                    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                </InsertItemTemplate>
                <ItemTemplate>
                    Filiaal:
                    <asp:Label ID="FiliaalLabel" runat="server" Text='<%# Bind("Filiaal") %>' />
                    <br />

                </ItemTemplate>
            </asp:FormView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>" 
                SelectCommand="SELECT Filiaal.Filiaal FROM Vacature INNER JOIN Filiaal ON Vacature.FiliaalId = Filiaal.Id WHERE (Vacature.Id = @Id)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="Id" QueryStringField="Id" />
                </SelectParameters>
            </asp:SqlDataSource>
Reply With Quote
  #4 (permalink)  
Old September 22nd, 2010, 08:25 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

If I understand you correctly (which I am still not sure about), you need to use FindControl on the FormView to find the TextBox inside.

http://www.google.com/search?hl=en&s...ontrol&gs_rfai=

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SMS API does not work online but work fine offline. Tonik Beginning PHP 1 January 4th, 2013 08:30 AM
Problem Getting SlideMenu to work brettk_1 ASP.NET 2.0 Basics 1 April 4th, 2007 09:48 AM
Big Problem - Validator don't work online Maxxim BOOK: ASP.NET Website Programming Problem-Design-Solution 2 September 12th, 2006 06:59 PM
problem deploying to work/standalone/localhost leonbrits Apache Tomcat 0 August 26th, 2005 07:22 AM
attachments lily611 Forum and Wrox.com Feedback 1 June 15th, 2004 08:37 AM



All times are GMT -4. The time now is 01:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.