Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals 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
 
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old March 14th, 2010, 02:47 PM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2008
Location: Tareem, Hadramout, Yemen.
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by PeterPeiGuo View Post
I think you misunderstood some of the replies above. Let's stay focused on the problem, and remember people are helping out of their kindness. Couple of things:
1) Yes, the link you give is a javascript containing code that generates html document or at least portion of it. The content of that javascript is served up by some PHP code;
2) If you want the same thing, the simplest way is to have the content (assume static) in a file and simply serve it as is;
3) You tried to generate that javascript from a piece of C# code, is that really necessary? If not, do what's mentioned in above point 2. Don't make things more difficult than needed.
4) If it's truly necessarily to generate from C#, read some of the above replies again, and try to understand what people said. All they said was: don't html encode your javascript portion, and the HtmlEncode() call away.

I choosed the option 3. As I think, I must use C#, because:
1) The link http://ads.adbrite.com/mb/text_group...s=3732385f3930 has url parameters. In my project, I want the same idea, I'll receive url parameters and want to manipulate those parameters. So manipulating them with C# and ADO.NET.
2) After manipulating the url parameters, a code like that is returned (See http://ads.adbrite.com/mb/text_group...s=3732385f3930) , and then used by a client side javascript.
3) The code returned is customized for each customer/refrral depends on the refrral /url-parameter received.
4) Actually, our project is "Advertisement network", that each customer has his own code provide by us, he embed it in his website.
5) The problem I faced when I used the people replies is :
when using HtmlEncode(), it becomes not valid javascript more, and when don't use HtmlEncode() the html tages is not appear inside the response, I mean they are executed by browser.. please guide us.

I hope you understood me clearly, and if confusing, please ask to clarify more. I'll will be glad of that.

Last edited by msman88; March 14th, 2010 at 02:51 PM..
  #12 (permalink)  
Old March 14th, 2010, 02:58 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Don't generate the entire javascript, but only what necessary. Let's assume 99% of your javascript is static, but you just want to pass in couple of things here and there, for example to form URL with parameters. Do something similar to this, and this is the best way to include dynamic content in your javascript from a ASP.net page. Try it out:
Code:
function showAlert()

{

alert('<%= TextBox1.ClientID %>');

}

</script>
The Following User Says Thank You to PeterPeiGuo For This Useful Post:
msman88 (March 14th, 2010)
  #13 (permalink)  
Old March 14th, 2010, 03:31 PM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2008
Location: Tareem, Hadramout, Yemen.
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Thumbs up

yes yes I understood you well, and I decide to choose this as best solution up to now.
What we name that? It's classic asp, isn't it?
Actually I worked only with asp.net, c# and ado.net, and I have never used classic asp in the past. It's clearly that I will need code stuff in classic asp for programming the issue, like following:
- The alternative of ado.net codes.
-Or in other meaning, codes that communicates with the database to retrieve data according to the url-parameters received.
- Other code you guess

Thanks..
  #14 (permalink)  
Old March 14th, 2010, 10:30 PM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2008
Location: Tareem, Hadramout, Yemen.
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

I worked with php previously, what's easier coding that I'll have? asp or php?
and my databases are in mssql server.
__________________
ASP.NET & C#
  #15 (permalink)  
Old March 14th, 2010, 10:41 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Personally I found them the same in terms of easiness, and both support template nicely, which to me is the most important criteria when you pick a web development framework.

But I do feel that ASP.Net have an upper hand in the sense of database access. Read about Microsoft Entity Framework, and you will like it. I believe, in the future developers will have less need to directly deal with database and queries.

But PHP is popular too, and lots of time it is cheaper to host PHP based web site.

Just couple of points to consider, I know I didn't give you a straight answer, but hope you will take the above points into consideration during your thought process.

Cheers! Feel free to discuss more.
The Following User Says Thank You to PeterPeiGuo For This Useful Post:
msman88 (March 14th, 2010)
  #16 (permalink)  
Old March 14th, 2010, 10:50 PM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2008
Location: Tareem, Hadramout, Yemen.
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Default

As I think in my mind, the Microsoft Entity Framework will be the alternative of ado.net in c#, I can say.
Isn't it?
__________________
ASP.NET & C#
  #17 (permalink)  
Old March 14th, 2010, 11:00 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

The fully qualified name of Entity Framework (EF) is actually ADO.Net Entity Framework.

One alternative is LINQ to SQL, which is also a Microsoft technology. However the trend is for EF. With new project, EF is the way to go. Also Microsoft's focus in the future is EF.
  #18 (permalink)  
Old March 16th, 2010, 08:05 AM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2008
Location: Tareem, Hadramout, Yemen.
Posts: 89
Thanks: 13
Thanked 0 Times in 0 Posts
Post

Can I access the database and retrieve the data from the aspx page itself and not using the c# or vb page belonged ?
Can I have codes for that purpose?
__________________
ASP.NET & C#
 


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
Difficulties with "web.config" and "ASPNETDB" CFRham BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 2 July 3rd, 2010 10:19 AM
Need code corrections "get sub or function not defined" error" bluesboytoo Excel VBA 1 October 22nd, 2009 11:12 PM
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 01:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM



All times are GMT -4. The time now is 06:44 AM.


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