|
Is there a particular reason you are writing VBscript to the client? As a general rule you should use Javascript for your client-side code, as many browsers will not run the VBscript.
And rather than use response.write, try creating a string vasriable with the required javascript (window.open...etc) then register that script on the client. (RegisterClientScriptBlock)
Fred
|
|
|
|
|
My site uses forms authentication (login control etc) to grant users access to the site.
Is there a way to programatically get their username once they have logged in ?
Thanks
|
|
|
|
|
Yes.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
It has been a long time since I last worked with this stuff, but you can try the Page.User.Identity.Name property, or see if you can get what you need by using the Membership.GetUser()[^] method.
Jon Sagara
Once again, the conservative sandwich-heavy portfolio pays off for the hungry investor! *slurp* Oh, I'm ruined!
-- Dr. Zoidberg
.NET Blog | Personal Blog | Articles
|
|
|
|
|
Yes, You can do it. There are various method available but the simplest way is to use 'cookies' , like this,
' on "Login.aspx.vb" page
Dim uname As String = Login1.UserName
Dim pwd As String = Login1.Password
e.Authenticated= FormsAuthentication.Authenticate(uname,pwd)
If FormsAuthentication.Authenticate(uname, pwd) Then
FormsAuthentication.RedirectFromLoginPage(uname, True)
Response.Cookies("CokieLogin").Value = uname
Else
Login1.FailureText = "Either User Name or Password is wrong."
End If
'On "Default.aspx.vb" page
Dim UserName As String = UCase(Request.Cookies("CokieLogin").Value)
'here we expire the cookies
Response.Cookies("CokieLogin").Expires = System.DateTime.Now()
prabhakar
|
|
|
|
|
I have The Menu in javascript on master page
and On content pages There are drop down lists
when we extract the menus The Drop down List On Content Page
Comes Over The javascript Menu In IE no problem with mizilla
Is there any Solution....
Thanks
swapnil
swapnil
|
|
|
|
|
This problem occurs while we are not designing our controls in tables. Try again your designing with in the tables.
To create a table do the following steps,
File > Layout > Insert Table >
Thanks,
Selvendran. P
|
|
|
|
|
My Drop down list is in proper table structures
Is There any other thing u want to say...
swapnil
|
|
|
|
|
I am combining 2 images on the fly and wanting to make the background of the 2nd image trasnparent. When the image is a gif the MakeTransparent Method works well but when its a jpg, it is very rough around the edges.
Any ideas will be helpful.
Jpg Example. We removed the background on the card case
<%<br />
Bitmap bitMapImage = new System.Drawing.Bitmap(Server.MapPath("photos/3092.jpg") );<br />
Graphics graphicImage = Graphics.FromImage(bitMapImage); <br />
graphicImage.SmoothingMode = SmoothingMode.AntiAlias;<br />
graphicImage.DrawString( "LOGO HERE", new Font("Arial", 12,FontStyle.Bold ), SystemBrushes.WindowText, new Point( 40, 150 ) );<br />
Bitmap myBitmap = new System.Drawing.Bitmap(Server.MapPath("upload/3003.jpg") );<br />
Color backColor = myBitmap.GetPixel(1, 1);<br />
myBitmap.MakeTransparent(backColor);<br />
graphicImage.DrawImage(myBitmap, 0, 40, myBitmap.Width, myBitmap.Height);<br />
Response.ContentType="image/jpeg";<br />
bitMapImage.Save(Response.OutputStream, ImageFormat.Jpeg);<br />
myBitmap.Save(Response.OutputStream, ImageFormat.Jpeg);<br />
graphicImage.Dispose();<br />
bitMapImage.Dispose();<br />
myBitmap.Dispose();<br />
%>
|
|
|
|
|
I found this code in DotNetNuke:
switch (Operator)
{
case SomeEnumerator.Equal:
return Blah(parameters);
break;
...
...
}
There were three case statements in there, and all of them essentially looked like the one I showed above. The compiler was generating warnings about the break statements being unreachable code (which in fact, they are).
This is the only place this was done. Why on earth would anyone let that warning go when it's so easy to fix?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: This is the only place this was done.
You mean this was the only case statement in which it was done? or the only switch statement in which it was done?
Either way, I think they just forgot to remove it as I don't see why would anyone keep it
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
perhaps because C# is crap, and will generate errors if you don't have a break after ever case statement, so they automatically put it in, and then didn't remove it, just in case ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: because C# is crap, and will generate errors if you don't have a break after ever case statement
Actually, the return statement is fine.
"A jump statement such as a break is required after each case block, including the last block whether it is a case statement or a default statement."
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Christian Graus wrote: perhaps because C# is crap, and will generate errors if you don't have a break after ever case statement
Actually that's just fine for me, prevents a lot of people producing a lot of bugs (compared to C++ where the break is not necessary).
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Hi,
I have a window-based application having a web-browser control in it. In web browser control i access a web-based application hosted on remote server. Web-based app can only be accessed via window-based web browser control. A user needs to login in window app. To implement user rights on different pages of web app i need to pass user's id from window app to web app.
Now i want to know how to share data between window app to web app.
Any help will be appreciated.
Thanx,
Anand
|
|
|
|
|
|
Hi All,
I would like to use a control on my page to be able to play MPEG file as they are uploaded to the page.
Can you please give me any information on how to go about it?
Thanks very much.
|
|
|
|
|
|
Thank you Vasudevan,
Can you please give me the steps in encoding the Window media player in to my page?
Its not a Toolbox control.Is it not?
Regards
kibrom
|
|
|
|
|
HI
I am trying to hardcode a folder name into an image url, the below will work if i pass my value into the database, but that will cause problems later on when i need just the file name
<asp:TemplateColumn HeaderText=Products >
<asp:Image Visible=true runat=server ID=imageHolder imageurl='<%#databinder.eval(container,"dataitem.imageAddress")%>' />
</ItemTemplate>
I am wanting to convert the above like somthing below, so that it will pull the correct image from the server,(below doesn't work)
<asp:TemplateColumn HeaderText=Products >
<asp:Image Visible=true runat=server ID=imageHolder imageurl='<%#databinder.eval(container,"/imagestore/"+"dataitem.imageAddress")%>' />
</ItemTemplate>
any help appreciated
cheers
boyindie
|
|
|
|
|
try this
<asp:Image runat="server" ID="imageHolder" imageurl='<%# "/imagestore/"+ Eval("imageAddress")%>' />
Best regard
pathan
---------------------------------------------------
|
|
|
|
|
|
Thanks
plz vote if U got solution
---------------------------------------------------
|
|
|
|
|
I am building a little non-profit web app, and would like to know the nicest way to offer my 'Enter' page. I would like the message to be database based, together with a link to a terms and conditions page, and an Enter button.
The message warns that entering by clicking the Enter button implies acceptance of the terms and conditions, which are accessible through a hyperlink between the message and the button. I would like the message and the button centred on the page in both planes, and do not want to use tables for this. Which control is best for the text? Label or Literal? And, how do I centre the stuff using CSS?
"Once in Africa I lost the corkscrew and we were forced to live off food and water for weeks." - Ernest Hemingway
My New Blog
|
|
|
|