|
Create a public function in your global module
Public Function SetFocus(ByVal FocusControl As Control) As String<br />
'Setting focus to supplied control<br />
Dim Script As New System.Text.StringBuilder<br />
Dim ClientID As String = FocusControl.ClientID<br />
<br />
'Building java script<br />
With Script<br />
.Append("<script language='javascript'>")<br />
.Append("document.getElementById('")<br />
.Append(ClientID)<br />
.Append("').focus();")<br />
.Append("</script>")<br />
End With<br />
<br />
Return Script.ToString()<br />
End Function
From your aspx form call that function to set focus on your textBox
'set focus <br />
RegisterStartupScript("setFocus", Utilities.SetFocus(txtName))
postmaster
www.programmingknowledge.com[^]
|
|
|
|
|
Sir,
Can i use menu items in vb.net 1.1.
If possible please send some links
Thanks
|
|
|
|
|
hello
i am learn with Design and Implementation Guidelines for Web Clients
http://msdn.microsoft.com/practices/apptype/webapps/default.aspx?pull=/library/en-us/dnpag/html/diforwc-ap02.asp#diforwc-ap02_plag_howtodesigncrudform
How To: Design Data Maintenance Forms to Support Create, Read, Update, and Delete Operations
but i have problem with
SQLHelperExtension.Fill(reader, customer, customer.Customer.TableName, 0, 1)
can help me what iam doing bad
i am using Imports Microsoft.ApplicationBlocks.Data i see the version and show me version 2
tnanks for the time
|
|
|
|
|
I've inherited a VB.NET 1.1 website and am trying to make some enhancements. It needs to remain a .NET 1.1 site.
I'm trying to merge in some pages from an old HTML site -- specifically, one that captures name and email address so visitors can subscribe to an email newsletter. It uses the old ASP model of a form (action=http://www.thirdpartyurl.com/emailsub.asp?CustID=12345, method=POST) that gets submitted to the third party mailing list manager with some pre-defined form fields filled in.
What's the best way to make this work under .NET 1.1? ASPX pages all post back to the originating server and page, so having the browser post to the new URL isn't working. I have to use the runat=server model because the page has a lot of server controls that must remain there (header, navigation, etc.)
I presume this means I have to use something at the server end to simulate that post -- what piece of the framework do I use for that? And then how do I capture the result? In the POST to the particular service we're using here, we specify three different pages back on our own site: one for a successful subscription, one for a successful UNsubscription, and one for an error (already subscribed, etc.). So that site will turn around and redirect us to the proper page (on our own site) for feedback. How might I capture that and redirect accordingly?
Thanks in advance....!
Rob Schripsema
Integra Software and Services
|
|
|
|
|
RobSchripsema wrote: I have to use the runat=server model because the page has a lot of server controls that must remain there (header, navigation, etc.)
That doesn't mean that the form that you post has to be the form with runat="server".
---
b { font-weight: normal; }
|
|
|
|
|
OK, please explain.
The POSTING form is on a larger page that contains a number of ASP web controls. My understanding and experience is that for those to work, the primary FORM item that ASP.NET pages contain must be set to Runat=Server.
I know the form I am intending to post TO could be anything -- even a PERL CGI script or something. My concern is how to get the form I'm hosting and using to capture information to appear to post to a different URL with a standard HTTP POST method.
Rob Schripsema
DeWaard & Jones Company
|
|
|
|
|
OK, please again.
Just because you have a form with runat="server", doesn't mean that you actually have to USE it.
You can have any number of forms on the page, as long as only one of them has runat="server", and no form is inside another. You can set up a form with hidden fields that you copy data to, and that you can post anywhere you like.
---
b { font-weight: normal; }
|
|
|
|
|
Hello There
I have installed my web application on win 2003 Server. This application is a "network service" as security is windows integrated. Now when user click export button in my application the application has to create one Excel file and export it. but on creating a file it says Access is denied. If I changed the service from "network Service" to "Local Service" then I did not get the Username from user.identity..
I am stuck some where, Where application is ready but cannot show it to customer.
Please suggest me what to do ?
|
|
|
|
|
Sir,
I am proceeding for a project named Library Management project.I can code but don't know how to proceed .I mean I don't have any requirement that's y i am facing problems.If i get the help for what r the main issues i mean what r the main requirements in the Online Library management System Project.Can i get any link to this online project.
PLease help
Thanks.
|
|
|
|
|
Ask your professor
only two letters away from being an asset
|
|
|
|
|
Sir,
please help .and i think we r here to help each other.
Thanks.
|
|
|
|
|
If you doing it as your class project then YES Ask your professor
If you doing it for a group of user then talk to them to get your requirements.
== postmaster
www.programmingknowledge.com[^]
|
|
|
|
|
Sir,
I am doing this project just for my knowledge .That's y i need ur help.
Please send any link.
Thanks
|
|
|
|
|
Then ask yourself what the requirements are for your application. Don't ask us.
only two letters away from being an asset
|
|
|
|
|
Very Basic requirements could be:
1. Allow user to login into your system.
2. Check user's access right.
3. Allow browse the system.
4. Allow search the system
5. Allow admin to add, edit or remove records.
and so on
=postmaster
www.programmingknowledge.com
|
|
|
|
|
can anybody explain me how exactly
System.Web.Security.FormsAuthentication.SignOut()
will work.
in my page in the pageload event, for some condition i had given System.Web.Security.FormsAuthentication.SignOut() and after that Exit sub.
The condition is evaluated to true and the Code (System.Web.Security.FormsAuthentication.SignOut() ) was executed without error, and after wards, exit sub tooo.
the problem is as soon as FormsAuthentication.SignOut() is executed it is not signing out of the page (redirect to login page)instead the current page stays, and when i do any postbacks again , it is redirecting to login page.
Im i doing anything wrong, if so what is the correct usage of FormsAuthentication.SignOut()
Thanks,
harsh
|
|
|
|
|
MSDN documentation is conflicted on this
When the SignOut method is called, a redirect to the application's login page is made by calling the Redirect method with the endResponse parameter set to false.
Yet it also says
You can use the SignOut method in conjunction with the RedirectToLoginPage method to log one user out and allow a different user to log in.
Just go call RedirectToLoginPage after SignOut to be sure
only two letters away from being an asset
|
|
|
|
|
Sir,
What are Secured Socket Layers .I want to implement it in the project.(an online project).
Please help.
Thanks
Can i get a code project linkin vb.net with asp.net that uses the Secure Sockets Layer (SSL)?
|
|
|
|
|
Hi,
I am at cient place and getting very strange problem with my asp.net application............when i call my web application from any desktop machine in lan it's working fine(even from my laptop it's working fine) but when i called it from the any of the client LAPTOP (HP make) having Window XP Prfession ver 2002 i am get the main page properly,but when i click on any of the image button/link button (on click of this i am calling response.redirect("Page..") ) nothing get's happend.
I check for firewall and Antivirus but nothing is there........
Also when i click any where on page it get's postback.I also noticed that when i click on image button/link button 4-5 times continously i get the redirected page..........
and this problem is occuring in all client Laptop........
When i traced the iis log for the request sent i got this...
Request From Laptop......
14:21:23 10.110.2.63 GET /tepedmts/DSSMainPage.aspx 200
14:21:25 10.110.2.63 POST /tepedmts/DSSMainPage.aspx 200 (Here i click on button)
Request From normal machine where it works fine...
14:22:20 127.0.0.1 POST /TEPEDMTS/DSSMainPage.aspx 302
14:22:20 127.0.0.1 GET /TEPEDMTS/DocumentReport.aspx 200
Can anyone explain me this weired behaviour and what could be the solution...
Thanx,
Ritesh
|
|
|
|
|
I'm working on getting a search results total working for a database search application I am building. I've tried setting a variable equal to GridView1.Rows.Count but that only returns the number of rows for the first page of the GridView. How can I get it to count all the rows from each page? I've been searching for hours and still cannot find something that works. I'm still pretty new at asp so any help would be appreciated.
Thanks
|
|
|
|
|
Get the count from the datasource you have assigned to the grid
only two letters away from being an asset
|
|
|
|
|
Wow I finally figured out a way to do it. This is what i used:
Protected Sub SqlDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Selected
resultsNumberLabel.Text = e.AffectedRows.ToString & " record(s) found."
End Sub
|
|
|
|
|
Hi
I need to restrict the size of image at the time of uploading.
So please tell me the suggestion.
Thanking u,
Naren
please help me
|
|
|
|
|
You could find you answers at Chris Khoo post
http://www.codeproject.com/aspnet/netimageupload.asp
Based in that post i made these two functions for asp.net C#.
you must to invoice the public function. The parameters are:
MaxWidth = max Width pixels
MaxHeight = max height pixels
UrlAndFileName = the From address image
UrlAndNewFileName = the save address and new file name
Example: (600, 600, "C:\Documents and Settings\Barriosj.FMMB\Mis documentos\Mis imágenes\imagenes\73237_4611.jpg", "c:/myRedimImage.jpg")
The image is restricted by the smallest width or heigth value.
public void Redim_And_SaveImg(int MaxWidth, int MaxHeight, string UrlAndFileName, string UrlAndnewFileName)
{
// load up the image, figure out a "best fit"
// resize, and then save that new image
Bitmap OriginalBmp = (System.Drawing.Bitmap)Image.FromFile(UrlAndFileName).Clone();
Size ResizedDimensions = ObtainDim(MaxWidth, MaxHeight, ref OriginalBmp);
Bitmap NewBmp = new Bitmap(OriginalBmp, ResizedDimensions);
NewBmp.Save(UrlAndnewFileName, System.Drawing.Imaging.ImageFormat.Jpeg);
}
private static Size ObtainDim(int MaxWidth, int MaxHeight, ref Bitmap Bmp)
{
int Width;
int Height;
float Multiplier;
Height = Bmp.Height;
Width = Bmp.Width;
// this means you want to shrink
// an image that is already shrunken!
if (Height <= MaxHeight && Width <= MaxWidth)
return new Size(Width, Height);
// check to see if we can shrink it width first
Multiplier = (float)((float)MaxWidth / (float)Width);
if ((Height * Multiplier) <= MaxHeight)
{
Height = (int)(Height * Multiplier);
return new Size(MaxWidth, Height);
}
// if we can't get our max width, then use the max height
Multiplier = (float)MaxHeight / (float)Height;
Width = (int)(Width * Multiplier);
return new Size(Width, MaxHeight);
}
keep Learning and you never will be out of date...
|
|
|
|
|
I have a problem in datagrid.
what i have to do, i have to display a record in datagrid from databse.
i have a feild status in my same table , i have to check if status has 0 then it must display "No" in the status field, and "Yes" if status value is 1.
plz tell me how can i do it.
any suggestion.
|
|
|
|