This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / ASP.net高手请进我想在网页里放一个固定的窗口,这个窗口不做别的,只用来显示其它的网页用,比如放新浪或者网易.但在窗口里放的网页需要是动态的,我需要按一个键窗口里显示新浪,按另外一个键窗口里显示网易,也就是说我要用程序来设置此窗口的URL.请教各位高手,在asp.net里是否提供这样的控件来实现此功能?多谢!
-jeff2ll(jeff);
2005-1-19
{282}
(#2083832@0)
-
IFRAME, FRAME
-canadiantire(轮胎-扎了三个钉子!);
2005-1-19
(#2083852@0)
-
多谢!不过iframe是client端的,不知asp.net是否提供server端的控件?这样实现起来会方便许多(因为url的生成逻辑比较复杂)
-jeff2ll(jeff);
2005-1-19
(#2083869@0)
-
你那几个键作成提交form不就行啦? target都在那个frame里面...
-expertune(伪劣);
2005-1-19
(#2083881@0)
-
也是,就是麻烦些.本来还想偷偷懒....
-jeff2ll(jeff);
2005-1-19
(#2083886@0)
-
set iframe's runat="server"
-feihong(feihong);
2005-1-21
(#2086362@0)
-
Option 1: web user control; Option 2: Reload page with dynamically configured request string each time you want change. (The first option seems to be easier. )
-orange0(桔子);
2005-1-20
(#2084147@0)
-
多谢!第一种方案比较好,不过不知道如何做这样的user control. ASP.net的image control都能设置url,为什么.net不提供能实现此功能的control呢?用iframe就是用的第二种的方案,我知道能行得通,不过调了一整天都没有调出来,不知道问题出在哪.
-jeff2ll(jeff);
2005-1-20
{92}
(#2085061@0)
-
做一个空白的.ascx, 在Page_Load里面写Response.Redirect("http://XXXX"), 当然得自己生成URL, 然后把它拖进你的网页...
-orange0(桔子);
2005-1-20
(#2085115@0)
-
这个方案看起来比用下面的用ATTRIBUTE 更简单, 有没有DX 有雅兴试验一下行不行. 我现在没有VS, 就免啦.
-roo(baloon);
2005-1-21
(#2086627@0)
-
这个办法把页面分成了两个文件, 从程序的重复使用角度说是可取的, 但是对于目前这个问题, 组件里面只有一行程序, 好象用不着这样...
-guest3(guest);
2005-1-21
(#2086659@0)
-
yes, using attribute is much easier. Before I just didn't know I could set those HTML elements' attributes using .NET. Because of this, in fact, we can consider HTML elements as web control too.
-jeff2ll(jeff);
2005-1-21
(#2086695@0)
-
Donot get mad! you are another guy to enter into ms trap. your case can easily be handled by html, why bother so-call web control. Donot be mad!!! Good day
-elecskunk(elecskunk);
2005-1-21
(#2086246@0)
-
这个HTML除了FRAME还有其它方法吗? 楼主已经说了不想用FRAME.
-roo(baloon);
2005-1-21
(#2086271@0)
-
No
-elecskunk(elecskunk);
2005-1-21
(#2086280@0)
-
I do not particulary hate to use frame or iframe. It is just because they make programming much more difficult. After all, I need to get those dynamic URL generated by server and database,
-jeff2ll(jeff);
2005-1-21
(#2086313@0)
-
你这个动态URL是每次load page更新一次,还是经常更新?
-luoboyang(萝卜秧);
2005-1-21
(#2086326@0)
-
often
-jeff2ll(jeff);
2005-1-21
(#2086336@0)
-
almost every button in the webpage has to change the URL dynamically
-jeff2ll(jeff);
2005-1-21
(#2086340@0)
-
等一下,我正在做个试验
-luoboyang(萝卜秧);
2005-1-21
(#2086359@0)
-
好了,看这里:
-luoboyang(萝卜秧);
2005-1-21
{576}
(#2086436@0)
-
Great!!!!!! Thank you very much .....This is what exactly what I want.I have believed microsoft must have provided something to solve such question
-jeff2ll(jeff);
2005-1-21
{77}
(#2086448@0)
-
这里关键的地方就是要把client side的control 在code behind里面定义出来,这样就可以为所欲为了,基本上。:)
-luoboyang(萝卜秧);
2005-1-21
(#2086455@0)
-
many thanks to luoboyang!!! I have implemented your solution in my program. I guess it's the easiest way that I can wish.
-jeff2ll(jeff);
2005-1-21
(#2086486@0)
-
My pleasure! 共同学习,共同提高,共同进步。:))
-luoboyang(萝卜秧);
2005-1-21
(#2086497@0)
-
but iframe or frame are only good when you already get the URL in client site. BTW, I do not think it is a trap of Microsoft. If you wanna such have website with such a function, it won't be easy for any other programming tools either.
-jeff2ll(jeff);
2005-1-21
{59}
(#2086324@0)
-
using javascript plus xmlhttp component plus layer will give you all flexibility
-nice2002(+3);
2005-1-21
(#2086335@0)
-
Can you provide an example with what you have mentioned? Thanks.
-jeff2ll(jeff);
2005-1-21
(#2086348@0)
-
some hintfunction getpage()
{
var objHTTP = new ActiveXObject("Microsoft.XMLHTTP")
objHTTP.Open('GET',http://www.yahoo.com',false)
objHTTP.Send()
var txt= objHTTP.ResponseText
...
}
This will get content from site,then write the txt into layer you created, if you make url to be variable, you will get page dynamically when you click button
..
-nice2002(+3);
2005-1-21
{352}
(#2086417@0)
-
Not that easy pal, and for some dynamic content it will failed.
-canadiantire(轮胎-扎了三个钉子!);
2005-1-21
(#2086437@0)
-
有那么麻烦么?
-canadiantire(轮胎-扎了三个钉子!);
2005-1-21
{768}
(#2086395@0)
-
the example you gave is not a solution. It is easy because you use JavaScript and define the URLs in the program in the client site already. How do you get those URLs if they are in the database?
-jeff2ll(jeff);
2005-1-21
(#2086439@0)
-
#2086436
-luoboyang(萝卜秧);
2005-1-21
(#2086443@0)
-
You can pass the value from database to javascript function.
-jetsfan(新人);
2005-1-21
(#2086460@0)
-
I don't like some ASP dot Net developer, wonder why? not because they don't understamd ASP can output dynamic content, but their attitude, hehe.
-canadiantire(轮胎-扎了三个钉子!);
2005-1-21
(#2086582@0)
-
well, my attitude is good. I have thanked you, right? :-) BTW, I am not a .net developer. I used to be an Oracle DBA but now I am just a student.I like to ask questions. Your solution just doesn't seem to fit my requirement. exactly. Fortunately, finnally I got the solution I need.
-jeff2ll(jeff);
2005-1-21
{139}
(#2086600@0)
-
你的code不错,就是不是楼主的要求。全在client side了。:)
-luoboyang(萝卜秧);
2005-1-21
(#2086441@0)
-
Thanks, your solution fits better.
-canadiantire(轮胎-扎了三个钉子!);
2005-1-21
(#2086574@0)
-
This guy is something. let .cs output html for you, donot use web-control. While, somebody bing-de-bu-qing.
-elecskunk(elecskunk);
2005-1-21
(#2086453@0)
-
well, don't be so critical. every person has his(her) own preference and opinions. You think it is impossible, right? However, luoboyang gave me the best solution I want.....
-jeff2ll(jeff);
2005-1-21
(#2086468@0)
-
No way.It's impossible to create a server side control acting as a browser.
-uniquemember(TjHong);
2005-1-21
{69}
(#2087271@0)
-
没有才要写啊.
-javacup(风铃);
2005-1-22
(#2088164@0)