Showing posts with label user. Show all posts
Showing posts with label user. Show all posts

Saturday, March 31, 2012

Submitting Using Javascript

Hi everyone,

My question is related to making a form submit using javascript. Here is my
scenario. I have a form, which includes a user control. The user control
has a search button and a submit button. I have visably hidden th search
button by setting its appearance and added an HTML button which calls the
click event of my real server control button.

This works fine.

I now want to cause the click event of the search button to be called when
the user hits the enter key in the text search text box. I have done this by
using the OnKeyDown event of the body tag and check if the character is the
enter key. This does invoke the function and I can do an alert('hello
world'); to prove it is working.

However . . . . . . .

If I try and call the real search button click() from this event nothing
happens.

Does anyone have insight into what I am doing wrong or how I can resolve it.

Many ThanksThis is probably a bug but for some reason asp.net doesn't sent the form
post variables to the web server if one textbox is on the page. So, calling
the button click() would actually post the form; but asp.net would not run
any server side processing since it has no clue on what control caused the
postback. There is a way around this. You can drop an extra textbox on the
page and hide it with css. If 2 textboxes are on the page then all the form
post variables will be sent along with the page and calling the click() on
the button would actually run the server side code. To hide the textbox you
can do something like this:

<asp:TextBox runat="server" style="display:hidden;visibility:none;" />

I hope this works.

"Goofy" <me@.mine.comwrote in message
news:eNZ#6Jt7GHA.4288@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi everyone,
>
My question is related to making a form submit using javascript. Here is
my scenario. I have a form, which includes a user control. The user
control has a search button and a submit button. I have visably hidden th
search button by setting its appearance and added an HTML button which
calls the click event of my real server control button.
>
This works fine.
>
I now want to cause the click event of the search button to be called when
the user hits the enter key in the text search text box. I have done this
by using the OnKeyDown event of the body tag and check if the character is
the enter key. This does invoke the function and I can do an alert('hello
world'); to prove it is working.
>
However . . . . . . .
>
If I try and call the real search button click() from this event nothing
happens.
>
Does anyone have insight into what I am doing wrong or how I can resolve
it.
>
Many Thanks
>
>
>
>
>


Having made this change, when the enter key is pressed the form is
submitted, but I dont want a default submission, I need it to be the
btnSearch

function OKD(){ if (window.event.keyCode == 13 )
{
MultiProjectPicker1_btnSearch.click();
event.returnValue=false;
event.cancel = true; }
}

"tdavisjr" <tdavisjr@.gmail.comwrote in message
news:%23PRIIZt7GHA.4408@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

This is probably a bug but for some reason asp.net doesn't sent the form
post variables to the web server if one textbox is on the page. So,
calling the button click() would actually post the form; but asp.net would
not run any server side processing since it has no clue on what control
caused the postback. There is a way around this. You can drop an extra
textbox on the page and hide it with css. If 2 textboxes are on the page
then all the form post variables will be sent along with the page and
calling the click() on the button would actually run the server side code.
To hide the textbox you can do something like this:
>
<asp:TextBox runat="server" style="display:hidden;visibility:none;" />
>
I hope this works.
>
"Goofy" <me@.mine.comwrote in message
news:eNZ#6Jt7GHA.4288@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>Hi everyone,
>>
>My question is related to making a form submit using javascript. Here is
>my scenario. I have a form, which includes a user control. The user
>control has a search button and a submit button. I have visably hidden th
>search button by setting its appearance and added an HTML button which
>calls the click event of my real server control button.
>>
>This works fine.
>>
>I now want to cause the click event of the search button to be called
>when the user hits the enter key in the text search text box. I have done
>this by using the OnKeyDown event of the body tag and check if the
>character is the enter key. This does invoke the function and I can do an
>alert('hello world'); to prove it is working.
>>
>However . . . . . . .
>>
>If I try and call the real search button click() from this event nothing
>happens.
>>
>Does anyone have insight into what I am doing wrong or how I can resolve
>it.
>>
>Many Thanks
>>
>>
>>
>>
>>


there are several possible problems.

1) you specified invisible for the button. this will cause the button to not
render, so there is nothing for javascript to call.

2) you are not using validation, so the button is a standard submit button.
in this case there is not a onclick routine to call.

a simple solution for what you want is to use onchange on the textbx and set
autopostback. then asp.net will generate javascript to postback.

-- bruce (sqlwork.com)

"Goofy" <me@.mine.comwrote in message
news:eNZ%236Jt7GHA.4288@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi everyone,
>
My question is related to making a form submit using javascript. Here is
my scenario. I have a form, which includes a user control. The user
control has a search button and a submit button. I have visably hidden th
search button by setting its appearance and added an HTML button which
calls the click event of my real server control button.
>
This works fine.
>
I now want to cause the click event of the search button to be called when
the user hits the enter key in the text search text box. I have done this
by using the OnKeyDown event of the body tag and check if the character is
the enter key. This does invoke the function and I can do an alert('hello
world'); to prove it is working.
>
However . . . . . . .
>
If I try and call the real search button click() from this event nothing
happens.
>
Does anyone have insight into what I am doing wrong or how I can resolve
it.
>
Many Thanks
>
>
>
>
>


Excellent

Just goes to show, the simple solution is easy once you know it. I never
thought to use AP on this, what a dummy I am.

Cheers

"bruce barker (sqlwork.com)" <b_r_u_c_e_removeunderscores@.sqlwork.comwrote
in message news:ukVX54t7GHA.2384@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

there are several possible problems.
>
1) you specified invisible for the button. this will cause the button to
not render, so there is nothing for javascript to call.
>
2) you are not using validation, so the button is a standard submit
button. in this case there is not a onclick routine to call.
>
a simple solution for what you want is to use onchange on the textbx and
set autopostback. then asp.net will generate javascript to postback.
>
>
-- bruce (sqlwork.com)
>
>
>
>
"Goofy" <me@.mine.comwrote in message
news:eNZ%236Jt7GHA.4288@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>Hi everyone,
>>
>My question is related to making a form submit using javascript. Here is
>my scenario. I have a form, which includes a user control. The user
>control has a search button and a submit button. I have visably hidden th
>search button by setting its appearance and added an HTML button which
>calls the click event of my real server control button.
>>
>This works fine.
>>
>I now want to cause the click event of the search button to be called
>when the user hits the enter key in the text search text box. I have done
>this by using the OnKeyDown event of the body tag and check if the
>character is the enter key. This does invoke the function and I can do an
>alert('hello world'); to prove it is working.
>>
>However . . . . . . .
>>
>If I try and call the real search button click() from this event nothing
>happens.
>>
>Does anyone have insight into what I am doing wrong or how I can resolve
>it.
>>
>Many Thanks
>>
>>
>>
>>
>>


>
>

Submitting Using Javascript

Hi everyone,
My question is related to making a form submit using javascript. Here is my
scenario. I have a form, which includes a user control. The user control
has a search button and a submit button. I have visably hidden th search
button by setting its appearance and added an HTML button which calls the
click event of my real server control button.
This works fine.
I now want to cause the click event of the search button to be called when
the user hits the enter key in the text search text box. I have done this by
using the OnKeyDown event of the body tag and check if the character is the
enter key. This does invoke the function and I can do an alert('hello
world'); to prove it is working.
However . . . . . . .
If I try and call the real search button click() from this event nothing
happens.
Does anyone have insight into what I am doing wrong or how I can resolve it.
Many ThanksThis is probably a bug but for some reason asp.net doesn't sent the form
post variables to the web server if one textbox is on the page. So, calling
the button click() would actually post the form; but asp.net would not run
any server side processing since it has no clue on what control caused the
postback. There is a way around this. You can drop an extra textbox on the
page and hide it with css. If 2 textboxes are on the page then all the form
post variables will be sent along with the page and calling the click() on
the button would actually run the server side code. To hide the textbox you
can do something like this:
<asp:TextBox runat="server" style="display:hidden;visibility:none;" />
I hope this works.
"Goofy" <me@.mine.com> wrote in message
news:eNZ#6Jt7GHA.4288@.TK2MSFTNGP02.phx.gbl...
> Hi everyone,
> My question is related to making a form submit using javascript. Here is
> my scenario. I have a form, which includes a user control. The user
> control has a search button and a submit button. I have visably hidden th
> search button by setting its appearance and added an HTML button which
> calls the click event of my real server control button.
> This works fine.
> I now want to cause the click event of the search button to be called when
> the user hits the enter key in the text search text box. I have done this
> by using the OnKeyDown event of the body tag and check if the character is
> the enter key. This does invoke the function and I can do an alert('hello
> world'); to prove it is working.
> However . . . . . . .
> If I try and call the real search button click() from this event nothing
> happens.
> Does anyone have insight into what I am doing wrong or how I can resolve
> it.
> Many Thanks
>
>
>
Having made this change, when the enter key is pressed the form is
submitted, but I dont want a default submission, I need it to be the
btnSearch
function OKD(){ if (window.event.keyCode == 13 )
{
MultiProjectPicker1_btnSearch.click();
event.returnValue=false;
event.cancel = true; }
}
"tdavisjr" <tdavisjr@.gmail.com> wrote in message
news:%23PRIIZt7GHA.4408@.TK2MSFTNGP02.phx.gbl...
> This is probably a bug but for some reason asp.net doesn't sent the form
> post variables to the web server if one textbox is on the page. So,
> calling the button click() would actually post the form; but asp.net would
> not run any server side processing since it has no clue on what control
> caused the postback. There is a way around this. You can drop an extra
> textbox on the page and hide it with css. If 2 textboxes are on the page
> then all the form post variables will be sent along with the page and
> calling the click() on the button would actually run the server side code.
> To hide the textbox you can do something like this:
> <asp:TextBox runat="server" style="display:hidden;visibility:none;" />
> I hope this works.
> "Goofy" <me@.mine.com> wrote in message
> news:eNZ#6Jt7GHA.4288@.TK2MSFTNGP02.phx.gbl...
there are several possible problems.
1) you specified invisible for the button. this will cause the button to not
render, so there is nothing for javascript to call.
2) you are not using validation, so the button is a standard submit button.
in this case there is not a onclick routine to call.
a simple solution for what you want is to use onchange on the textbx and set
autopostback. then asp.net will generate javascript to postback.
-- bruce (sqlwork.com)
"Goofy" <me@.mine.com> wrote in message
news:eNZ%236Jt7GHA.4288@.TK2MSFTNGP02.phx.gbl...
> Hi everyone,
> My question is related to making a form submit using javascript. Here is
> my scenario. I have a form, which includes a user control. The user
> control has a search button and a submit button. I have visably hidden th
> search button by setting its appearance and added an HTML button which
> calls the click event of my real server control button.
> This works fine.
> I now want to cause the click event of the search button to be called when
> the user hits the enter key in the text search text box. I have done this
> by using the OnKeyDown event of the body tag and check if the character is
> the enter key. This does invoke the function and I can do an alert('hello
> world'); to prove it is working.
> However . . . . . . .
> If I try and call the real search button click() from this event nothing
> happens.
> Does anyone have insight into what I am doing wrong or how I can resolve
> it.
> Many Thanks
>
>
>
Excellent
Just goes to show, the simple solution is easy once you know it. I never
thought to use AP on this, what a dummy I am.
Cheers
"bruce barker (sqlwork.com)" <b_r_u_c_e_removeunderscores@.sqlwork.com> wrote
in message news:ukVX54t7GHA.2384@.TK2MSFTNGP04.phx.gbl...
> there are several possible problems.
> 1) you specified invisible for the button. this will cause the button to
> not render, so there is nothing for javascript to call.
> 2) you are not using validation, so the button is a standard submit
> button. in this case there is not a onclick routine to call.
> a simple solution for what you want is to use onchange on the textbx and
> set autopostback. then asp.net will generate javascript to postback.
>
> -- bruce (sqlwork.com)
>
>
> "Goofy" <me@.mine.com> wrote in message
> news:eNZ%236Jt7GHA.4288@.TK2MSFTNGP02.phx.gbl...
>

Subscription Form in e-mail

Hi,
Sales guy came up with this idea for clients subscribing to a new service they want to implement.

User's will fill out a subscribtion form, and the data on it will be submitted to the database. Once the subscribtion is approved, a confirmation mail is send to the user.

From my standpoint, I guessed the subscribtion form would be a normal page hosted on the host. But they want to MAIL this page to clients, and clients should be able to fill out the form in the mail.

Now one get this mails where the body is a web page (or so it seems). So I need to know if one can have a page on the internet, but this page can also be filled in from within a mail body. Know what I'm saying?

CheersHmm, maybe you could just email them a link to the form they need to fill out? But, you can send html type emails, so you could try setting up a form string of html, with your fields and such, and set the action of the form to your aspx page that is going to process the form. And then send the html string email to them.
Hmm, maybe you could just email them a link to the form they need to fill out?. Thought about that too, but boss allready saw mails containing web pages, so need to give him a honest answer if it's possible or not.
But, you can send html type emails, so you could try setting up a form string of html, with your fields and such, and set the action of the form to your aspx page that is going to process the form. And then send the html string email to them.Make sense with the bit I figured out so far. Can anyone else comment on this?
You might even be able to send an IFrame with the src set to your registration project, which then you wouldn't have to send a form through the email, and would be alot simpler.
that make sense. you mean the body of the mail is a iFrame, and the iFrame's src property is set to say www.MySite.com/services/newsletter/signup.aspx?
that make sense. you mean the body of the mail is a iFrame, and the iFrame's src property is set to say www.MySite.com/services/newsletter/signup.aspx?
Yeah, just make sure the email is sent as html, you can set this when/if you use SMTP mail. I'd say give the IFrame a go and see how it works out.

Good luck;

Subscriptions

Hi,

I'm working on a site that requries a subscription. I have ruled out storing CC details in a database so that means that either a user pays for several months at once and then has to manually make another payment when the time is up or else an independent payment company holds on to the details. Perhaps the bank could do this?

Anyone know anything about these latter ideas?

Cheers, WT.

There are companies like PayPal out there that could do your processing for you. Microsoft's Visual Web Developer Express has a starter kit for a PayPal eCommerce site.

http://msdn.microsoft.com/vstudio/express/vwd/starterkit/default.aspx#paypal

Hope that helps

Craist
If the site is small, I suggest using a third party Merchant Account and/or PayPal. Like you said, storing CC details in your own database is not a good idee unless you have major security and I think it's not legal unless the CC Company approuve.
But do these companies hold on to the CC details so that the customer can automatically be charged each month?
Yes they do

Wednesday, March 28, 2012

Successful Download Tracking

Hello,

Currently on my Website my downloads are simply hyperlinks to binary
files, which when clicked, prompt the user for download. I would like to
try and track my downloads and determine if the entire file was transferred
to the user's machine. Is there a way to do this? Do I need a specialized
httphandler?

Thanks,

MikeInstead of an HttpHandler, why don't you look at an
HttpModule. It will allow you to intercept both incoming
and outgoing calls so that you can log the downloads
while allowing ASP.NET to continue to do it's thing.

Bruce Johnson
http://www.objectsharp.com/Bruce

>--Original Message--
>Hello,
> Currently on my Website my downloads are simply
hyperlinks to binary
>files, which when clicked, prompt the user for
download. I would like to
>try and track my downloads and determine if the entire
file was transferred
>to the user's machine. Is there a way to do this? Do I
need a specialized
>httphandler?
>Thanks,
>Mike
>
>.

Suddenly being prompted for username and password on new site?

I have a small site that I launched a week ago. All static pages other than one page that emails user inquiries to me. I just had the default permissions and no extra authentication setup, no logins, etc. I changed one word on one page this morning, published the site to our webserver through VS2003, everything worked fine. I modified one other page, basically commenting out a <DIV> tag, published the site. Now it prompts me for a username and password for every page. If I keep hitting the cancel button, the page will eventually display, sometimes only partially (some graphics might be missing, the header and/or sidebar image are missing on some pages), but the page displays with at least most of the info.

I didn't touch the directory/file or IIS configuration, didn't edit the web.config file, etc. I tried un-commenting the DIV tag, but nothing changes. It works fine on the http://localhost web server on my development machine through VS.

What permissions should the default anonymous website visitor have in the website directory/sub-dirs/files?

What can I do to fix this, it's on our live site. Thanks.

After thinking about it and the way the graphics weren't all showing, I dug some more and discovered that when I clicked on my /Images directory, I got an 'access is denied' dialog on the server. I rebooted the web server and then the /Images directory didn't show up at all, so I re-published the website from VS and it works now. Freaky...

Suddenly Noticed ASP.net as user account on my computer

Can anyone tell me why "ASP.net Machine A" recently started showing up as one of my user accounts on my computer? Does this have something to do with Service Pack 2? It says it's a limited account and password protect but I didn't set it up. What's the deal?The following FAQ will explain the ASPNET account, and will show you how to remove it.
Why is there an ASP.NET account on my machine?

my problem is similar except it is asking for a password for this account and is now requiring a password for my own account before it will launch windows. I have never set up a password so I don't know how to get into my computer to uninstall the ASP.Net account. Even bringing it up in Safe Mode it is still asking for a password.

Does anyone have a solution for this?

Monday, March 26, 2012

Suggestion regarding Top/footer includes

Hello,

I have the following situation. On all of my pages I would like to include a top and footer ascx file. Therefore I created two user controls. Now the the top.ascx contains another usercontrol which is a menu and shown in a table and each link in that menu is seperated with a line break. Somethin like this:

link1
link2
link3
...

Now this menu is in a table. The table looks like this:

<table width="100%">
<tbody>
<tr valign="top">
<td width="15%">
MENU HERE
</td>
<td>
CONTENT WILL BE HERE
</td>
</tr>
</tbody>
</table
Now I need to get rid of everything what comes after the MENU HERE <TD>, because this will be used for my main content. and the table will be closed then in the footer. However webmatrix always adds the missing html tags and therefore my table always looks like shown above. I hope that you guys understand what I mean. Is there anything I can do or is this is the wrong way?

ThanksI recommend that you use MasterPages, where you place the footer/header in that template.

Regards.
Arent MasterPages only in 2.0? I am using 1.1.
Nop, try to download this forum code and see how master pages are being used.

regards.
Thanks haider_balal,

I can imagine that the code for this forum is complicated and that it contains a lot of stuff. Isnt there an easier article which explains master pages in 1.1?
Hello, try to check this and give me your opinion:

MasterPages Templating Framework

regards.
2.0 will be so much fun
Why wait till asp.net 2.0 ? We can still use it in 1.1 !!!!!

regards.

Suggestion Regarding Securing the ASP.NET Web Page......

Hi Everybody,
I have problem regarding security of the page. I want that the every asp.net
web page is accessed via application. If a user directly access the page via
writing the address of the page in the address bar. Then It should be
blocked to access the page.
I have two options in my mind.
1. Using Query String Parameters
2. Using Session Object
But I got the following problem with these techniques.
WIth Query String the problem is that if the user access the page via
application then the query string parameters are shown in the address bar so
there he can used these parameters in the direct access, which i did not
want.
With Session Object, If the user login from the application then its session
is created. so now he can write the direct address in the address bar to
access the page directly which i dont want.
Actully My application is frames base application.
There are threee frames vertically
1) Header
2) Body ( Body Portion contains the two horizontal frames )
2.1) Menu
2.2) Content
3) Footer
In the menu area user selects the menu and against that menu the page is
loaded in the content portion.
So please help me how can i block user to access the page directly.
Regards,
Muhammad Jamil NawazThe Request object will have an HttpRequest.UrlReferrer Property. If this
property does not have a value then it means that the user has typed the
URI. This is not a foolproff method though but can still keep the average
user.
Regards,
Trevor Benedict R
MCSD
"Muhammad Jamil Nawaz" <jamfiza12@.hotmail.com> wrote in message
news:%23$JElX80FHA.2752@.TK2MSFTNGP12.phx.gbl...
> Hi Everybody,
> I have problem regarding security of the page. I want that the every
> asp.net
> web page is accessed via application. If a user directly access the page
> via
> writing the address of the page in the address bar. Then It should be
> blocked to access the page.
> I have two options in my mind.
> 1. Using Query String Parameters
> 2. Using Session Object
> But I got the following problem with these techniques.
> WIth Query String the problem is that if the user access the page via
> application then the query string parameters are shown in the address bar
> so
> there he can used these parameters in the direct access, which i did not
> want.
> With Session Object, If the user login from the application then its
> session
> is created. so now he can write the direct address in the address bar to
> access the page directly which i dont want.
> Actully My application is frames base application.
> There are threee frames vertically
> 1) Header
> 2) Body ( Body Portion contains the two horizontal frames )
> 2.1) Menu
> 2.2) Content
> 3) Footer
> In the menu area user selects the menu and against that menu the page is
> loaded in the content portion.
> So please help me how can i block user to access the page directly.
> Regards,
> Muhammad Jamil Nawaz
>
Use Session.
Use the sessionstate as "auto" mode (not cookieless = false) to also
take care of scenarios where cookies may be disabled (a large section
of corporates disable cookies).
Cheers,
Gaurav Vaish
http://mastergaurav.org
--

Suggestions for ASP.NET Data Repeater

Right. Any suggestions on how to layout data to look like the following? I tried using a a web user control with a repeater in it, and for each different location create a new user web control and bind only the establishments applicable to that location to that repeater... but for some reason the repeaters or any other data controls aren't instantiated inside the web user control. Total pain in the bum.

The salient fields in the Establishments table in relation to the image are:
ID, Name, Area

The ID is just the ID for each establishment, the name is the name (e.g. "Arklow Bay Confer...", "Glenart Castle Hotel", "Ballyknocked Coun..." etc. etc."), and the Area (e.g. Arklow, Ashford, Aughrim, Blessington).

Any thoughts on how I could design my Repeater or Grid etc to display everything, but to group by the Area field as in the image?This is coming from a database, correct? And you have control over the recordset that is returned?
Absolute and complete control yes
Have two datatables filled up in your dataset.

First:

EstablishmentID+LongName

Second:

EstablishmentID+Area

You can then add a relationship between them, and bind it to the repeater. Styling it as you wish of course.

Here's an example:
http://support.microsoft.com/default.aspx?scid=kb;en-us;326338
Cool thanks I'll have a look at that!
Post your code when it works. It's helpful for searches. :)
Didn't take too much tinkering to get it working. I'll post a fuller example in a little while...

<asp:Repeater id="parentRepeater" runat="server">
<itemtemplate>
<b>
<%#DataBinder.Eval(Container.DataItem, "[Area Name]")%>
</b>
<br>
<asp:Repeater id="childRepeater" runat="server" datasource='<%#Container.DataItem.Row.GetChildRows("myrelation")%>'>
<itemtemplate>
<%#Container.DataItem("Name")%><br>
</itemtemplate>
</asp:Repeater>
</itemtemplate>
</asp:Repeater>

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cnn As SqlConnection = New SqlConnection("Data Source=localhost;Initial Catalog=SomeDB;Integrated Security=True;Pooling=False")
Dim cmd1 As SqlDataAdapter = New SqlDataAdapter("select * from areas", cnn)
Dim ds As DataSet = New DataSet()
cmd1.Fill(ds, "areas")

Dim cmd2 As SqlDataAdapter = New SqlDataAdapter("select * from establishments", cnn)
cmd2.Fill(ds, "establishments")

ds.Relations.Add("myrelation", ds.Tables("areas").Columns(0), ds.Tables("establishments").Columns(14))
parentRepeater.DataSource = ds.Tables("areas")

Page.DataBind()
cnn.Close()
End Sub

Saturday, March 24, 2012

Suggestions for the arquitecture of the site

Hi,

I'm looking into putting together a site that would model a book where each user would be able to subscribe to the chapters. For example, a user could subscribe to chapters 1 and 5 and another user could subscribe to chapters 2 and 3.

Any suggestions on how to implement the security? Any sites out there with examples, tutorials, etc?

Any help is appreciated.

Thanks.Hi,

some information to start with:Authentication and Authorization.

I don't know about examples for what you're asking right now but I would suggest that you first model your database and then try to visualize things in a neat way.

Grz, Kris.
I'm familiar with the basics on authorization. Specifically forms authorization...

I'm looking for something more targeted at the fact of having several chapters... I know how to configure the application so that users have to sign-up and login in order to read the whole "book" - just haven't figured out how to do it by chapter...

Thanks for the reply.
You could use roles. I assume you have what users are authorized to view what chapters in a database...just assign these to whatever implementation of IPrincipal you're using when they log in and then check on the page (or use the web.config) for something like if(User.IsInRole("Chapter4")) ...

Suggestions on how to ...

Can anyone suggest a good way of achieving the following;

I have a database table that contains say 30 records. I want my user to be able to view a list of all of these records and then select which ones they want to appear in a report. So they might select only one record, they might select 5 different ones. I want the records they selected to appear in one place on the screen and the others to appear elsewhere at the same time. Then they click on a button and my code uses the primary keys of only the selected records to extract data from my table.

I think you might be able to achieve this by using two listboxes side-by-side in an html table but the text that the user will need to identify the record is going to be over 200 characters long.

Thanks in advance.Have you considered using a datagrid? Do you know how to? Datagrids also allow you to wrap your text in a cell onto the next line.

Suggestions to build Newsletter

Hi.

I want to build Newsletter to about 100 thousand user.

what is the best way to send that huge E-mails .

I think to use Thread.Sleep(500) after evry mail , is that good way , is there any more professional ways?

Good Evening Kojoh,

There are multiple was to do it, How I do it, is store the email addresses in a database, sql server 2005 but you can use the express version if you so choose, then you can either use sql to send the email(I don't think you can do this with the express version) but you can use asp.net to do it. You can just create a list and then send it via system.net.mail or if you have access to your own mail server, create a distribution list based on the addresses stored in the database. Totally up to you. Not sure your requirements or utilities at your disposure.

Joshua


thank's dearfolkertsj .

I don't ask how to send mail , I know how to do it . but my question is if I use to send thousands of mails one time it will hung the server.

Regards.


Indeed - the issue is how to send bulk emails.

There are lots of ways to achieve this safely. I find the simplest and easiest way is to use a bulk email component. The one I typically use for this isAspEmail (works with ASP and ASP.NET) as it has support for just about everything you can think of.


DearBSolveIT Thank's for your replay ,

I know the code and I have host server that support SMTP Server . I wl explain more:

I use like this code:

while (ReaderUsers.Read()) { MailAddress To =new MailAddress(ReaderUsers["UserMail"].ToString()); MailAddress From =new MailAddress("Email@.Email.com"); MailMessage MyMail =new MailMessage(From, To); MyMail.Subject ="Subject"; MyMail.Body ="the body"; SmtpClient smtp =new SmtpClient("my smtp Server"); smtp.Send(MyMail); }

This Reader contain a thousands of recored . if I send it like this I will make a problems in the server I gess. how can solve this problem , is it good done if I useSystem.Threading.Thread.Sleep() between E-Mails?


Hi Kojoh

I would suggest that you probably don't want to do that. I understand that you want to slow down the speed at which the emails are generated, but then you're also going to end up with a page that will take a LONG time to process... which you'll then have to cater for.

Better, as I mentioned, is to use a bulk email component. The one I mentioned uses it's own SMTP server, and handles it's own queue. However, it has 64 SMTP threads allowing it to send hundreds of emails a second.

If you don't have your own server, ask your hosting company if there is a bulk email capable component installed on the server that you can use. if they haven't got one, ask if they would consider installing the one I suggested.


BSolveIT:

If you don't have your own server, ask your hosting company if there is a bulk email capable component installed on the server that you can use. if they haven't got one, ask if they would consider installing the one I suggested.

Thank's alotBSolveIT.

my host need extra money to do that, now I look to do that by the code!! is there any suggestions ?.


up.


I strongly advise to switch to a host that has support for this, as either way you're current host is likely to be unhappy.

Super weird problem

I have a really strange problem. I've implemented a website using a lot of user controls (ascx). Everything worked fine before, and it has run for months.

And today, suddenly all those user controls (scrolling messages, tabstrips, menu, etc) don't work anymore, i.e. nothing appears although there's no error message. And I do not change anything, the codes remain exactly the same as before.

The web controls (textBox, calendar, buttons, etc) on the main page (not in ascx) still work fine.

I've spent, in vain, a lot of hours trying to figure it out. Do you have an idea what's going wrong ? I really appreciate your help.

Thanks

Btw, the codes are quite long, so I won't post it here. But if you need to see a part of it, just let me know, I'll post it.> nothing appears although there's no error message.

What exactly do you mean, "nothing appears"? If you View > Source, what do you see? Have the ASCX controls not be added at all? Or have they been added but not rendered?

Also, the elements you mention as having ceased to work look as though they'd use Javascript. Even if you haven't changed the ASCX or ASPX files, have you perhaps changed an external javascript file? I once forgot to add ";" to the end of a new line of script ... and it broke myentire site!
Things always get broken when no one has changed anything :)

If truly nothing has changed, try resetting IIS, as something might be confused in there...

Most likely though, as SomeNewKid2 said, it might be possible you made a change to something and didn't think it would even affect the controls...

But I could be wrong too :)
If the site is being hosted, I would check with the hosting site that they haven't upgraded the .net framework to 1.1.

Thursday, March 22, 2012

Support

is it possible to invoke an hour glass in my asp .net application when I
invoke a user action such as clicking a button.
I've tried putting "Document.style.cursor=Wait" in the beginning of the
JavaScript function and changing the cursor back to "Default" at the end,
but of no use.

My problem is that the cursor is changing to the hour glass only after the
entire function gets executed, which makes the purpose nullified. Please let
me know what I can do in this aspect or is there any way I can forcefully
invoke the hour glass (or at least some flashy progress bar) immediately
after I click the button.You can place on JavaScript that changes to hourglass, then run the rest of
the code, then change it back. It is also possible to place a "waiting"
layer up for the user and then have client side script make the layer
invisible.

There is not much else you can do, as you are running all code on the client
side.

BTW< some of the groups you have crossposted are really not on topic.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Support" <anonymous@.discussions.com> wrote in message
news:eqTg$tITEHA.3768@.TK2MSFTNGP11.phx.gbl...
> is it possible to invoke an hour glass in my asp .net application when I
> invoke a user action such as clicking a button.
> I've tried putting "Document.style.cursor=Wait" in the beginning of the
> JavaScript function and changing the cursor back to "Default" at the end,
> but of no use.
> My problem is that the cursor is changing to the hour glass only after the
> entire function gets executed, which makes the purpose nullified. Please
let
> me know what I can do in this aspect or is there any way I can forcefully
> invoke the hour glass (or at least some flashy progress bar) immediately
> after I click the button.

Support

is it possible to invoke an hour glass in my asp .net application when I
invoke a user action such as clicking a button.
I've tried putting "Document.style.cursor=Wait" in the beginning of the
JavaScript function and changing the cursor back to "Default" at the end,
but of no use.
My problem is that the cursor is changing to the hour glass only after the
entire function gets executed, which makes the purpose nullified. Please let
me know what I can do in this aspect or is there any way I can forcefully
invoke the hour glass (or at least some flashy progress bar) immediately
after I click the button.You can place on JavaScript that changes to hourglass, then run the rest of
the code, then change it back. It is also possible to place a "waiting"
layer up for the user and then have client side script make the layer
invisible.
There is not much else you can do, as you are running all code on the client
side.
BTW< some of the groups you have crossposted are really not on topic.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
****************************************
********
Think Outside the Box!
****************************************
********
"Support" <anonymous@.discussions.com> wrote in message
news:eqTg$tITEHA.3768@.TK2MSFTNGP11.phx.gbl...
> is it possible to invoke an hour glass in my asp .net application when I
> invoke a user action such as clicking a button.
> I've tried putting "Document.style.cursor=Wait" in the beginning of the
> JavaScript function and changing the cursor back to "Default" at the end,
> but of no use.
> My problem is that the cursor is changing to the hour glass only after the
> entire function gets executed, which makes the purpose nullified. Please
let
> me know what I can do in this aspect or is there any way I can forcefully
> invoke the hour glass (or at least some flashy progress bar) immediately
> after I click the button.
>

Supporting Languages - Welsh ?

How do I add the Welsh language to IE6 ?

And what would the ISO code be for it ?

I've tried using the User Defined cy as some sites say, but the following
code just uses the catch block as it's not found.

Try
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(Request.UserLang uages(0))
ls_language = Thread.CurrentThread.CurrentCulture.Name
Catch
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture("en-gb")
ls_language = Thread.CurrentThread.CurrentCulture.Name
End Try
HttpContext.Current.Response.Cookies.Add(New HttpCookie("Cul", ls_language))

--
Adrian Parker
Ingenuity At Work LtdHi Adrian,

Welcome to the MSDN newsgroup.

As for the "Welsh", it is still not included in the .net framework (both
1.1 and 2.0)'s predefined cultureInfo list:

#CultureInfo Class
http://msdn2.microsoft.com/en-us/li...cultureinfo.as
px

So even if we add a custom language header(for Welsh) in the http message
through IE's languages setting, the server-side ASP.NET application can not
find the direct mapped culture for it.

BTW, currently for windows XP(>SP2), if you're using .net framework 2.0,
there is a "Welsh" culture available in the OS's regional setting. And in
the .net framework 2.0 code, we can use the "cy-GB" to create the
CultureInfo specific to that setting.'

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Hi Steven,

So if we use cy-GB as our language, it would work, but only using net2.0 on XPsp2 ?

Is this currently supported on windows 2003 ? and if not now, when will it be ?

Thanks
--
Adrian Parker
Ingenuity At Work Ltd

"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message news:%23QOiBxPPGHA.2972@.TK2MSFTNGXA03.phx.gbl...
> Hi Adrian,
> Welcome to the MSDN newsgroup.
> As for the "Welsh", it is still not included in the .net framework (both
> 1.1 and 2.0)'s predefined cultureInfo list:
> #CultureInfo Class
> http://msdn2.microsoft.com/en-us/li...cultureinfo.as
> px
> So even if we add a custom language header(for Welsh) in the http message
> through IE's languages setting, the server-side ASP.NET application can not
> find the direct mapped culture for it.
> BTW, currently for windows XP(>SP2), if you're using .net framework 2.0,
> there is a "Welsh" culture available in the OS's regional setting. And in
> the .net framework 2.0 code, we can use the "cy-GB" to create the
> CultureInfo specific to that setting.'
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
Thanks for your response Adrian,

So far it is limited on other OS version and I haven't got any definite
info on when it'll also be upgrated to windows 2k3. However, for .net
framework 2.0, it doest provide some new features on extending the exiting
culture set regarding on the lack of some built-in or predefined culture in
framework or on windows OS.

#Extend Your Code's Global Reach With New Features In The .NET Framework 2.0
http://msdn.microsoft.com/msdnmag/i...on/default.aspx

Though it is still quite limited, we can use it to do handle some
additional conditions in .net 2.0 applications.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Supporting Languages - Welsh ?

How do I add the Welsh language to IE6 ?
And what would the ISO code be for it ?
I've tried using the User Defined cy as some sites say, but the following
code just uses the catch block as it's not found.
Try
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))
ls_language = Thread.CurrentThread.CurrentCulture.Name
Catch
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture("en-gb")
ls_language = Thread.CurrentThread.CurrentCulture.Name
End Try
HttpContext.Current.Response.Cookies.Add(New HttpCookie("Cul", ls_language))
Adrian Parker
Ingenuity At Work LtdHi Adrian,
Welcome to the MSDN newsgroup.
As for the "Welsh", it is still not included in the .net framework (both
1.1 and 2.0)'s predefined cultureInfo list:
#CultureInfo Class
http://msdn2.microsoft.com/en-us/li...cultureinfo.as
px
So even if we add a custom language header(for Welsh) in the http message
through IE's languages setting, the server-side ASP.NET application can not
find the direct mapped culture for it.
BTW, currently for windows XP(>SP2), if you're using .net framework 2.0,
there is a "Welsh" culture available in the OS's regional setting. And in
the .net framework 2.0 code, we can use the "cy-GB" to create the
CultureInfo specific to that setting.'
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Hi Steven,
So if we use cy-GB as our language, it would work, but only using net2.0 on
XPsp2 ?
Is this currently supported on windows 2003 ? and if not now, when will it b
e ?
Thanks
--
Adrian Parker
Ingenuity At Work Ltd
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message news:%23QOiBxPPGHA.2972@.TK2M
SFTNGXA03.phx.gbl...
> Hi Adrian,
> Welcome to the MSDN newsgroup.
> As for the "Welsh", it is still not included in the .net framework (both
> 1.1 and 2.0)'s predefined cultureInfo list:
> #CultureInfo Class
> [url]http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.as[/ur
l]
> px
> So even if we add a custom language header(for Welsh) in the http message
> through IE's languages setting, the server-side ASP.NET application can no
t
> find the direct mapped culture for it.
> BTW, currently for windows XP(>SP2), if you're using .net framework 2.0,
> there is a "Welsh" culture available in the OS's regional setting. And in
> the .net framework 2.0 code, we can use the "cy-GB" to create the
> CultureInfo specific to that setting.'
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
Thanks for your response Adrian,
So far it is limited on other OS version and I haven't got any definite
info on when it'll also be upgrated to windows 2k3. However, for .net
framework 2.0, it doest provide some new features on extending the exiting
culture set regarding on the lack of some built-in or predefined culture in
framework or on windows OS.
#Extend Your Code's Global Reach With New Features In The .NET Framework 2.0
http://msdn.microsoft.com/msdnmag/i...on/default.aspx
Though it is still quite limited, we can use it to do handle some
additional conditions in .net 2.0 applications.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Suppress Masterpage

hi,
I am looking into reusing code to limit number of pages.
When ever I display a user's name on the site, It is with a hyperlink so you
can view the user profile in a popup window.
Is there a way to suppress the masterpage when a page is shown in my popup
windows?
JonasSure, just don't specify a master page for the popup window.
In the page header, don't add a MasterPageFile attribute.
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Jonas Pedersen" <qwert@.qwerty.com> wrote in message
news:O$vof7RJIHA.484@.TK2MSFTNGP06.phx.gbl...
> hi,
> I am looking into reusing code to limit number of pages.
> When ever I display a user's name on the site, It is with a hyperlink so
> you can view the user profile in a popup window.
> Is there a way to suppress the masterpage when a page is shown in my popup
> windows?
> Jonas
>

Suppress Masterpage

hi,

I am looking into reusing code to limit number of pages.
When ever I display a user's name on the site, It is with a hyperlink so you
can view the user profile in a popup window.
Is there a way to suppress the masterpage when a page is shown in my popup
windows?

JonasSure, just don't specify a master page for the popup window.

In the page header, don't add a MasterPageFile attribute.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Jonas Pedersen" <qwert@.qwerty.comwrote in message
news:O$vof7RJIHA.484@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

hi,
>
I am looking into reusing code to limit number of pages.
When ever I display a user's name on the site, It is with a hyperlink so
you can view the user profile in a popup window.
Is there a way to suppress the masterpage when a page is shown in my popup
windows?
>
Jonas
>