Click here to Skip to main content
15,917,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, i have a very basic level question but unfortunately i have not worked this way so i don't know it.

question is, when we use the following format of aspx page, give below.
and how we transfer the control to this type of page.


VB
<%@ Page Language="VB" %>

<%
 'only the VB code will place on this entire page. no HTML tag is placed on it.
%>

this page does not make any effect at client end. but used only for doing some server end processing.
Posted
Comments
Sergey Alexandrovich Kryukov 21-Nov-11 3:00am    
Interesting. Why doing so? This is certainly a way of programming based on just HTML and .NET knowledge, but it would make powerful ASP.NET nearly equivalent to miserable PHP. Why?
--SA

For example, you can put all your HTML into one APS.NET literal control:

ASP.NET
<asp:Literal id="htmlLiteral" runat="server"/>


and then assign your HTML text to the property htmlLiteral.Text.

I wonder why being such a purist? :-) See my comment to the question.

—SA
 
Share this answer
 
v2
Comments
Zubair Alie 21-Nov-11 4:24am    
Thanks SAKryukov, i can understand this. am not to achieve the HTML dynamic rendering or scenario based rendering.

My Scenario is
I have a web page, i wish to post a call to another page for performing some action but i do not wish to lose the currently loaded page.
i mean to call Page2.aspx from Page1.aspx in such a way that Loaded page (page1.aspx) will not postback.
and i do not wish to use JSON as well.

hope you understand the scenario.
Zubair Alie 21-Nov-11 4:26am    
the provided problem is a way to persform some acotions on another webpage. this way we can create a webpage which is not having its exsitance for getting load. this page is just for background working.
but the thing is... how i can i send a call to it and the paramenters to pass.
My answer based on your question and comments posted in SA's answer.
Quote:
My Scenario is I have a web page, i wish to post a call to another page for performing some action but i do not wish to lose the currently loaded page. i mean to call Page2.aspx from Page1.aspx in such a way that Loaded page (page1.aspx) will not postback. and i do not wish to use JSON as well. hope you understand the scenario.

Why to program like Classic ASP when Asp.Net provides you Code-Behind file(Aspx.vb/Aspx.cs) for that?

If you want some other page to execute/process your functionality and return result back to your Page then use Ajax.

Have a look at below CodeProject Articles on this.

Using jQuery for AJAX in ASP.NET

Jquery Ajax Calling Functions

Simplifying Asp.Net Core Ajax
 
Share this answer
 
For your situation you can just specify a class in your project and call the methods of those class where the implementaions(which you said in the above page) can be done.



But still you can write a page with out html content. but what ever you write will be displayed as plain text(with out any effects)
 
Share this answer
 
Comments
Zubair Alie 24-Nov-11 23:24pm    
i have resolved the issue.
actually i meant to write a page on which i had to make only few lines to execute.

HTML side only contain <@Page> directive and .vb end had code inside it.

"This page i wrote to post back the control onto it through javascript and execute few lines of .vb code."

for me the question was...to how to post the data onto it. now the data has been posted to the page through HTTPContext object. :)

Thanks for your solution.
solution is abslutely wirte,but it was not the scenario to implement utility class.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900