Search Results

Search found 4334 results on 174 pages for 'sender'.

Page 40/174 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • openfire cannot subscribe gmail user

    - by cometta
    i trying to add gmail user with my local openfire, but get error below. I think something wrong with dns srv. can anyone suggest how to troubleshoot? </error> </presence> at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:217) at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.returnErrorToSender(OutgoingSessionPromise.java:285) at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.run(OutgoingSessionPromise.java:204) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:613) 2010.04.25 23:30:57 Error returning error to sender. Original packet: <presence id="lBI4K-24" to="[email protected]" type="subscribe" from="[email protected]"/> org.jivesoftware.openfire.PacketException: Cannot route packet of type IQ or Presence to bare JID: <presence id="lBI4K-24" to="[email protected]" from="[email protected]" type="error"> <error code="404" type="cancel"> <remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> </error> </presence> at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:217) at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.returnErrorToSender(OutgoingSessionPromise.java:285) at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.run(OutgoingSessionPromise.java:219) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:613) 2010.04.25 23:31:56 Error returning error to sender. Original packet: <presence id="gmEsS-26" to="[email protected]" type="subscribe" from="[email protected]"/> org.jivesoftware.openfire.PacketException: Cannot route packet of type IQ or Presence to bare JID: <presence id="gmEsS-26" to="[email protected]" from="[email protected]" type="error"> <error code="404" type="cancel"> <remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> </error> </presence> at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:217) at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.returnErrorToSender(OutgoingSessionPromise.java:285) at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.run(OutgoingSessionPromise.java:219) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:613) 2010.04.25 23:31:56 Error returning error to sender. Original packet: <presence id="gmEsS-27" to="[email protected]" type="subscribe" from="[email protected]"/> org.jivesoftware.openfire.PacketException: Cannot route packet of type IQ or Presence to bare JID: <presence id="gmEsS-27" to="[email protected]" from="[email protected]" type="error"> <error code="404" type="cancel"> <remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> </error> </presence> at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:217) at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.returnErrorToSender(OutgoingSessionPromise.java:285) at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.run(OutgoingSessionPromise.java:204) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:613)

    Read the article

  • ASP.NET Membership API not working on Win2008 server/IIS7

    - by Program.X
    I have a very odd problem. I have a web app that uses the .NET Membership API to provide login functionality. This works fine on my local dev machine, using WebDev 4.0 server. I'm using .NET 4.0 with some URL Rewriting, but not on the pages where login is required. I have a Windows Server 2008 with IIS7 However, the Membership API seemingly does not work on the server. I have set up remote debugging and the LoginUser.LoggedIn event of the LoginUser control gets fired okay, but the MembershipUser is null. I get no answer about the username/password being invalid so it seems to be recognising it. If I enter an invalid username/password, I get an invalid username/password response. Some code, if it helps: <asp:ValidationSummary ID="LoginUserValidationSummary" runat="server" CssClass="validation-error-list" ValidationGroup="LoginUserValidationGroup"/> <div class="accountInfo"> <fieldset class="login"> <legend>Account Information</legend> <p> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label> <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" CssClass="validation-error" Display="Dynamic" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator> </p> <p> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" CssClass="validation-error" Display="Dynamic" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator> </p> <p> <asp:CheckBox ID="RememberMe" runat="server"/> <asp:Label ID="RememberMeLabel" runat="server" AssociatedControlID="RememberMe" CssClass="inline">Keep me logged in</asp:Label> </p> </fieldset> <p class="login-action"> <asp:Button ID="LoginButton" runat="server" CommandName="Login" CssClass="submitButton" Text="Log In" ValidationGroup="LoginUserValidationGroup"/> </p> and the code behind: protected void Page_Load(object sender, EventArgs e) { LoginUser.LoginError += new EventHandler(LoginUser_LoginError); LoginUser.LoggedIn += new EventHandler(LoginUser_LoggedIn); } void LoginUser_LoggedIn(object sender, EventArgs e) { // this code gets run so it appears logins work Roles.DeleteCookie(); // this behaviour has been removed for testing - no difference } void LoginUser_LoginError(object sender, EventArgs e) { HtmlGenericControl htmlGenericControl = LoginUser.FindControl("errorMessageSpan") as HtmlGenericControl; if (htmlGenericControl != null) htmlGenericControl.Visible = true; } I have "Fiddled" with the Login form reponse and I get the following Cookie-Set headers: Set-Cookie: ASP.NET_SessionId=lpyyiyjw45jjtuav1gdu4jmg; path=/; HttpOnly Set-Cookie: .ASPXAUTH=A7AE08E071DD20872D6BBBAD9167A709DEE55B352283A7F91E1066FFB1529E5C61FCEDC86E558CEA1A837E79640BE88D1F65F14FA8434AA86407DA3AEED575E0649A1AC319752FBCD39B2A4669B0F869; path=/; HttpOnly Set-Cookie: .ASPXROLES=; expires=Mon, 11-Oct-1999 23:00:00 GMT; path=/; HttpOnly I don't know what is useful here because it is obviously encrypted but I find the .APXROLES cookie having no value interesting. It seems to fail to register the cookie, but passes authentication

    Read the article

  • Odd tcp deadlock under windows

    - by John Robertson
    We are moving large amounts of data on a LAN and it has to happen very rapidly and reliably. Currently we use windows TCP as implemented in C++. Using large (synchronous) sends moves the data much faster than a bunch of smaller (synchronous) sends but will frequently deadlock for large gaps of time (.15 seconds) causing the overall transfer rate to plummet. This deadlock happens in very particular circumstances which makes me believe it should be preventable altogether. More importantly if we don't really know the cause we don't really know it won't happen some time with smaller sends anyway. Can anyone explain this deadlock? Deadlock description (OK, zombie-locked, it isn't dead, but for .15 or so seconds it stops, then starts again) The receiving side sends an ACK. The sending side sends a packet containing the end of a message (push flag is set) The call to socket.recv takes about .15 seconds(!) to return About the time the call returns an ACK is sent by the receiving side The the next packet from the sender is finally sent (why is it waiting? the tcp window is plenty big) The odd thing about (3) is that typically that call doesn't take much time at all and receives exactly the same amount of data. On a 2Ghz machine that's 300 million instructions worth of time. I am assuming the call doesn't (heaven forbid) wait for the received data to be acked before it returns, so the ack must be waiting for the call to return, or both must be delayed by something else. The problem NEVER happens when there is a second packet of data (part of the same message) arriving between 1 and 2. That part very clearly makes it sound like it has to do with the fact that windows TCP will not send back a no-data ACK until either a second packet arrives or a 200ms timer expires. However the delay is less than 200 ms (its more like 150 ms). The third unseemly character (and to my mind the real culprit) is (5). Send is definitely being called well before that .15 seconds is up, but the data NEVER hits the wire before that ack returns. That is the most bizarre part of this deadlock to me. Its not a tcp blockage because the TCP window is plenty big since we set SO_RCVBUF to something like 500*1460 (which is still under a meg). The data is coming in very fast (basically there is a loop spinning out data via send) so the buffer should fill almost immediately. According to msdn the buffer being full and at least one pending send should cause the data to be sent (though in another place it mentions that there various "heuristics" used in deciding when a send hits the wire). Anway, why the sender doesn't actually send more data during that .15 second pause is the most bizarre part to me. The information above was captured on the receiving side via wireshark (except of course the socket.recv return times which were logged in a text file). We tried changing the send buffer to zero and turning off Nagle on the sender (yes, I know Nagle is about not sending small packets - but we tried turning Nagle off in case that was part of the unstated "heuristics" affecting whether the message would be posted to the wire. Technically microsoft's Nagle is that a small packet isn't sent if the buffer is full and there is an outstanding ACK, so it seemed like a possibility).

    Read the article

  • Email sent from server with rDNS & SPF being blocked by Hotmail

    - by Canadaka
    I have been unable to send email to users on hotmail or other Microsoft email servers for some time. Its been a major headache trying to find out why and how to fix the issue. The emails being sent that are blocked from my domain canadaka.net. I use Google Aps to host my regular email serverice for my @canadaka.net email addresses. I can sent email from my desktop or gmail to a hotmail without any problem. But any email sent from my server on behalf of canadaka.net is blocked, not even arriving in the junk email. The IP that the emails are being sent from is the same IP that my site is hosted on: 66.199.162.177 This IP is new to me since August 2010, I had a different IP for the previous 3-4 years. This IP is not on any credible spam lists http://www.anti-abuse.org/multi-rbl-check-results/?host=66.199.162.177 The one list spamcannibal.org my IP is listed on seems to be out of my control, says "no reverse DNS, MX host should have rDNS - RFC1912 2.1". But since I use Google for my email hosting, I don't have control over setting up RDNS for all the MX records. I do have Reverse DNS setup for my IP though, it resolves to "mail.canadaka.net". I have signed up for SNDS and was approved. My ip says "All of the specified IPs have normal status." Sender Score: 100 https://www.senderscore.org/lookup.php?lookup=66.199.162.177&ipLookup.x=55&ipLookup.y=14 My Mcafee threat level seems fine I have a TXT SPF record setup, I am currently using xname.org as my DNS, and they don't have a field for SPF, but their FAQ says to add the SPF info as a TXT entry. v=spf1 a include:_spf.google.com ~all Some "SPF checking" tools ive used detect that my domain has a valid SPF, but others don't. Like Microsoft's SPF wizard, i think this is because its specifically looking for an SPF record and not in the TXT. "No SPF Record Found. A and MX Records Available". From my home I can run "nslookup -type=TXT canadaka.net" and it returns: Server: google-public-dns-a.google.com Address: 8.8.8.8 Non-authoritative answer: canadaka.net text = "v=spf1 a include:_spf.google.com ~all" One strange thing I found is i'm unable to ping hotmail.com or msn.com or do a "telnet mail.hotmail.com 25". I am able to ping gmail.com and many other domains I tried. I tried changing my DNS servers to Google's Public DNS and did a ipconfig /flushdns but that had no effect. I am however able to connect with telnet to mx1.hotmail.com This is what the email headers look like when I send to a Google email server and I receive the email with no troubles. You can see that SPF is passing. Delivered-To: [email protected] Received: by 10.146.168.12 with SMTP id q12cs91243yae; Sun, 27 Feb 2011 18:01:49 -0800 (PST) Received: by 10.43.48.7 with SMTP id uu7mr4292541icb.68.1298858509242; Sun, 27 Feb 2011 18:01:49 -0800 (PST) Return-Path: Received: from canadaka.net ([66.199.162.177]) by mx.google.com with ESMTP id uh9si8493137icb.127.2011.02.27.18.01.45; Sun, 27 Feb 2011 18:01:48 -0800 (PST) Received-SPF: pass (google.com: domain of [email protected] designates 66.199.162.177 as permitted sender) client-ip=66.199.162.177; Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 66.199.162.177 as permitted sender) [email protected] Message-Id: <[email protected] Received: from coruscant ([127.0.0.1]:12907) by canadaka.net with [XMail 1.27 ESMTP Server] id for from ; Sun, 27 Feb 2011 18:01:29 -0800 Date: Sun, 27 Feb 2011 18:01:29 -0800 Subject: Test To: [email protected] From: XXXX Reply-To: [email protected] X-Mailer: PHP/5.2.13 I can send to gmail and other email services fine. I don't know what i'm doing wrong! UPDATE 1 I have been removed from hotmails IP block and am now able to send emails to hotmail, but they are all going directly to the JUNK folder. UPDATE 2 I used Telnet to send a test message to port25.com, seems my SPF is not being detected. Result: neutral (SPF-Result: None) canadaka.net. SPF (no records) canadaka.net. TXT (no records) I do have a TXT record, its been there for years, I did change it a week ago. Other sites that allow you to check your SPF detect it, but some others like Microsofts Wizard doesn't. This iw what my SPF record in my xname.org DNS file looks like: canadaka.net. 86400 IN TXT "v=spf1 a include:_spf.google.com ~all" I did have a nameserver as my 4th option that doens't have the TXT records since it doens't support it. So I removed it from the list and instead added wtfdns.com as my 4th adn 5th nameservers, which does support TXT.

    Read the article

  • postfix 5.7.1 Relay access denied when sending mail with cron

    - by zensys
    Reluctant to ask because there is so much here about 'postfix relay access denied' but I cannot find my case: I use php (Zend Framework) to send emails outside my network using the Google mail server because I could not send mail outside my server (user: web). However when I sent out an email via cron (user: root, I believe), still using ZF, using the same mail config/credentials, I get the message: '5.7.1 Relay access denied' I guess I need to know one of two things: 1. How can I use the google smtp server from cron 2. What do I need to change in my config to send mail using my own server instead of google Though the answer to 2. is the more structural solution I assume, I am quite happy with an answer to 1. as well because I think Google is better at server maintaince (security/spam) than I am. Below my ZF application.ini mail section, main.cf and master.cf: application.ini: resources.mail.transport.type = smtp resources.mail.transport.auth = login resources.mail.transport.host = "smtp.gmail.com" resources.mail.transport.ssl = tls resources.mail.transport.port = 587 resources.mail.transport.username = [email protected] resources.mail.transport.password = xxxxxxx resources.mail.defaultFrom.email = [email protected] resources.mail.defaultFrom.name = "my company" main.cf: # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h readme_directory = /usr/share/doc/postfix # TLS parameters smtpd_tls_cert_file = /etc/postfix/smtpd.cert smtpd_tls_key_file = /etc/postfix/smtpd.key smtpd_use_tls = yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = mail.second-start.nl mydomain = second-start.nl alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all html_directory = /usr/share/doc/postfix/html message_size_limit = 30720000 virtual_alias_domains = virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf virtual_mailbox_base = /home/vmail virtual_uid_maps = static:5000 virtual_gid_maps = static:5000 smtpd_sasl_auth_enable = yes broken_sasl_auth_clients = yes smtpd_sasl_authenticated_header = yes # see under Spam smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps virtual_transport = dovecot dovecot_destination_recipient_limit = 1 # Spam disable_vrfy_command = yes smtpd_delay_reject = yes smtpd_helo_required = yes smtpd_helo_restrictions = permit_mynetworks, check_helo_access hash:/etc/postfix/helo_access, reject_non_fqdn_hostname, reject_invalid_hostname, permit smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination, reject_invalid_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, permit_mynetworks, reject_non_fqdn_hostname, reject_rbl_client sbl.spamhaus.org, reject_rbl_client zen.spamhaus.org, reject_rbl_client cbl.abuseat.org, reject_rbl_client bl.spamcop.net, permit smtpd_error_sleep_time = 1s smtpd_soft_error_limit = 10 smtpd_hard_error_limit = 20 master.cf: # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) # ========================================================================== smtp inet n - - - - smtpd #smtp inet n - - - 1 postscreen #smtpd pass - - - - - smtpd #dnsblog unix - - - - 0 dnsblog #tlsproxy unix - - - - 0 tlsproxy #submission inet n - - - - smtpd # -o smtpd_tls_security_level=encrypt # -o smtpd_sasl_auth_enable=yes # -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING #smtps inet n - - - - smtpd # -o smtpd_tls_wrappermode=yes # -o smtpd_sasl_auth_enable=yes # -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING #628 inet n - - - - qmqpd pickup fifo n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr fifo n - n 300 1 qmgr #qmgr fifo n - - 300 1 oqmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp # When relaying mail as backup MX, disable fallback_relay to avoid MX loops relay unix - - - - - smtp -o smtp_fallback_relay= # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - n n - - local virtual unix - n n - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache # # ==================================================================== # Interfaces to non-Postfix software. Be sure to examine the manual # pages of the non-Postfix software to find out what options it wants. # # Many of the following services use the Postfix pipe(8) delivery # agent. See the pipe(8) man page for information about ${recipient} # and other message envelope options. # ==================================================================== # # maildrop. See the Postfix MAILDROP_README file for details. # Also specify in main.cf: maildrop_destination_recipient_limit=1 # maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} # # ==================================================================== # # Recent Cyrus versions can use the existing "lmtp" master.cf entry. # # Specify in cyrus.conf: # lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4 # # Specify in main.cf one or more of the following: # mailbox_transport = lmtp:inet:localhost # virtual_transport = lmtp:inet:localhost # # ==================================================================== # # Cyrus 2.1.5 (Amos Gouaux) # Also specify in main.cf: cyrus_destination_recipient_limit=1 # #cyrus unix - n n - - pipe # user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} # # ==================================================================== # Old example of delivery via Cyrus. # #old-cyrus unix - n n - - pipe # flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} # # ==================================================================== # # See the Postfix UUCP_README file for configuration details. # uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) # # Other external delivery methods. # ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - n n - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix - n n - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} mailman unix - n n - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}

    Read the article

  • HTML and PHP simple contact form.

    - by user317128
    I tried to make a simple contact form via HTML and PHP but the form doesnt seem to submit. it stays on the HTML page and doesnt post to the php form. would love someone to look over the code, thanks in advanced. simple_form.html cdoe <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Simple Feedback Form</title> </head> <body> <form action="send_simpleform.php" method="post"> <p>Your name<br /> <input name="sender_name" type="text" size="30" /></p> <p>Email<br /> <input name="sender_email" type="text" size="30" /></p> <p>Message<br /> <textarea name="message" cols="30" rows="5"></textarea></p> <input name="submit" type="button" value="Send This Form" /> </form> </body> </html> send_simpleform.php code <? if (($_POST[sender_name] == "") || ($_POST[sender_email] == "") || ($_POST[message] == "") { header("Location: simple_form.php"); exit; } $msg = "Email sent from wwwsite\n"; $msg .= "Sender's Name:\t $_POST[senders_name]\n"; $msg .= "Sender's E-mail:\t $_POST[senders_email]\n"; $msg .= "Sender's Message:\t $_POST[message]\n"; $to = "[email protected]"; $subject = "Website feedback message"; $mailheaders = "From: My web site <www.testwebsite.com>\n"; $mailherders .= "Reply to: $_POST[sender_email]\n"; $mail($to, $subject, $msg, $mailheaders); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Simple Feedback Form Sent</title> </head> <body> <h1>The following email has been sent</h1> <p>Your Name:<br /> <? echo "$_POST[sender_name]"; ?> <p>Your Email Adress:<br /> <? echo "$_POST[sender_email]"; ?> <p>Message:<br /> <? echo "$_POST[message]"; ?> </p> </body> </html>

    Read the article

  • DataGridView CheckBox events

    - by Kevin
    I'm making a DataGridView with a series of Checkboxes in it with the same labels horizontally and vertically. Any labels that are the same, the checkboxes will be inactive, and I only want one of the two "checks" for each combination to be valid. The following screenshot shows what I have: Anything that's checked on the lower half, I want UN-checked on the upper. So if [quux, spam] (or [7, 8] for zero-based co-ordinates) is checked, I want [spam, quux] ([8, 7]) un-checked. What I have so far is the following: dgvSysGrid.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders; dgvSysGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; string[] allsysNames = { "heya", "there", "lots", "of", "names", "foo", "bar", "quux", "spam", "eggs", "bacon" }; // Add a column for each entry, and a row for each entry, and mark the "diagonals" as readonly for (int i = 0; i < allsysNames.Length; i++) { dgvSysGrid.Columns.Add(new DataGridViewCheckBoxColumn(false)); dgvSysGrid.Columns[i].HeaderText = allsysNames[i]; dgvSysGrid.Rows.Add(); dgvSysGrid.Rows[i].HeaderCell.Value = allsysNames[i]; // Mark all of the "diagonals" as unable to change DataGridViewCell curDiagonal = dgvSysGrid[i, i]; curDiagonal.ReadOnly = true; curDiagonal.Style.BackColor = Color.Black; curDiagonal.Style.ForeColor = Color.Black; } // Hook up the event handler so that we can change the "corresponding" checkboxes as needed //dgvSysGrid.CurrentCellDirtyStateChanged += new EventHandler(dgvSysGrid_CurrentCellDirtyStateChanged); dgvSysGrid.CellValueChanged += new DataGridViewCellEventHandler(dgvSysGrid_CellValueChanged); } void dgvSysGrid_CellValueChanged(object sender, DataGridViewCellEventArgs e) { Point cur = new Point(e.ColumnIndex, e.RowIndex); // Change the diagonal checkbox to the opposite state DataGridViewCheckBoxCell curCell = (DataGridViewCheckBoxCell)dgvSysGrid[cur.X, cur.Y]; DataGridViewCheckBoxCell diagCell = (DataGridViewCheckBoxCell)dgvSysGrid[cur.Y, cur.X]; if ((bool)(curCell.Value) == true) { diagCell.Value = false; } else { diagCell.Value = true; } } /// <summary> /// Change the corresponding checkbox to the opposite state of the current one /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void dgvSysGrid_CurrentCellDirtyStateChanged(object sender, EventArgs e) { Point cur = dgvSysGrid.CurrentCellAddress; // Change the diagonal checkbox to the opposite state DataGridViewCheckBoxCell curCell = (DataGridViewCheckBoxCell)dgvSysGrid[cur.X, cur.Y]; DataGridViewCheckBoxCell diagCell = (DataGridViewCheckBoxCell)dgvSysGrid[cur.Y, cur.X]; if ((bool)(curCell.Value) == true) { diagCell.Value = false; } else { diagCell.Value = true; } } The problem comes is that the cell value changed always seems to be "one behind" where you actually click if I use the CellValueChanged event, and I'm not sure how to get the current cell if I'm in the "dirty" state as curCell comes in as a null (suggesting the current cell address is wrong somehow, but I didn't try and get that value out) meaning that path isn't working at all. Basically, how do I get the "right" address with the right boolean value so that my flipping algorithm will work?

    Read the article

  • SharePoint: Problem with BaseFieldControl

    - by Anoop
    Hi All, In below code in a Gird First column is BaseFieldControl from a column of type Choice of SPList. Secound column is a text box control with textchange event. Both the controls are created at rowdatabound event of gridview. Now the problem is that when Steps: 1) select any of the value from BaseFieldControl(DropDownList) which is rendered from Choice Column of SPList 2) enter any thing in textbox in another column of grid. 3) textchanged event fires up and in textchange event rebound the grid. Problem: the selected value becomes the first item or the default value(if any). but if i do not rebound the grid at text changed event it works fine. Please suggest what to do. using System; using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; namespace SharePointProjectTest.Layouts.SharePointProjectTest { public partial class TestBFC : LayoutsPageBase { GridView grid = null; protected void Page_Load(object sender, EventArgs e) { try { grid = new GridView(); grid.ShowFooter = true; grid.ShowHeader = true; grid.AutoGenerateColumns = true; grid.ID = "grdView"; grid.RowDataBound += new GridViewRowEventHandler(grid_RowDataBound); grid.Width = Unit.Pixel(900); MasterPage holder = (MasterPage)Page.Controls[0]; holder.FindControl("PlaceHolderMain").Controls.Add(grid); DataTable ds = new DataTable(); ds.Columns.Add("Choice"); //ds.Columns.Add("person"); ds.Columns.Add("Curr"); for (int i = 0; i < 3; i++) { DataRow dr = ds.NewRow(); ds.Rows.Add(dr); } grid.DataSource = ds; grid.DataBind(); } catch (Exception ex) { } } void tx_TextChanged(object sender, EventArgs e) { DataTable ds = new DataTable(); ds.Columns.Add("Choice"); ds.Columns.Add("Curr"); for (int i = 0; i < 3; i++) { DataRow dr = ds.NewRow(); ds.Rows.Add(dr); } grid.DataSource = ds; grid.DataBind(); } void grid_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { SPWeb web = SPContext.Current.Web; SPList list = web.Lists["Source for test"]; SPField field = list.Fields["Choice"]; SPListItem item=list.Items.Add(); BaseFieldControl control = (BaseFieldControl)GetSharePointControls(field, list, item, SPControlMode.New); if (control != null) { e.Row.Cells[0].Controls.Add(control); } TextBox tx = new TextBox(); tx.AutoPostBack = true; tx.ID = "Curr"; tx.TextChanged += new EventHandler(tx_TextChanged); e.Row.Cells[1].Controls.Add(tx); } } public static Control GetSharePointControls(SPField field, SPList list, SPListItem item, SPControlMode mode) { if (field == null || field.FieldRenderingControl == null || field.Hidden) return null; try { BaseFieldControl webControl = field.FieldRenderingControl; webControl.ListId = list.ID; webControl.ItemId = item.ID; webControl.FieldName = field.Title; webControl.ID = "id_" + field.InternalName; webControl.ControlMode = mode; webControl.EnableViewState = true; return webControl; } catch (Exception ex) { return null; } } } }

    Read the article

  • Why a graphics overflow problem as a result of a for loop?

    - by sonny5
    using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Drawing.Imaging; using System.Drawing.Drawing2D; public class Form1 : System.Windows.Forms.Form { public static float WXmin; public static float WYmin; public static float WXmax; public static float WYmax; public static int VXmin; public static int VYmin; public static int VXmax; public static int VYmax; public static float Wx; public static float Wy; public static float Vx; public static float Vy; public Form1() { InitializeComponent(); } private void InitializeComponent() { this.ClientSize = new System.Drawing.Size(400, 300); this.Text="Pass Args"; this.Paint += new System.Windows.Forms.PaintEventHandler(this.doLine); //this.Paint += new System.PaintEventHandler(this.eachCornerPix); //eachCornerPix(out Wx, out Wy, out Vx, out Vy); } static void Main() { Application.Run(new Form1()); } private void doLine(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; g.FillRectangle(Brushes.White, this.ClientRectangle); Pen p = new Pen(Color.Black); g.DrawLine(p, 0, 0, 100, 100); // draw DOWN in y, which is positive since no matrix called eachCornerPix(sender, e, out Wx, out Wy, out Vx, out Vy); p.Dispose(); } private void eachCornerPix (object sender, System.EventArgs e, out float Wx, out float Wy, out float Vx, out float Vy) { Wx = 0.0f; Wy = 0.0f; Vx = 0.0f; Vy = 0.0f; Graphics g = this.CreateGraphics(); Pen penBlu = new Pen(Color.Blue, 2); SolidBrush redBrush = new SolidBrush(Color.Red); int width = 2; // 1 pixel wide in x int height = 2; float [] Wxc = {0.100f, 5.900f, 5.900f, 0.100f}; float [] Wyc = {0.100f, 0.100f, 3.900f, 3.900f}; Console.WriteLine("Wxc[0] = {0}", Wxc[0]); Console.WriteLine("Wyc[3] = {0}", Wyc[3]); /* for (int i = 0; i<3; i++) { Wx = Wxc[i]; Wy = Wyc[i]; Vx = ((Wx - WXmin)*((VXmax-VXmin)+VXmin)/(WXmax-WXmin)); Vy = ((Wy - WYmin)*(VYmax-VYmin)/(WYmax-WYmin)+VYmin); Console.WriteLine("eachCornerPix Vx= {0}", Vx); Console.WriteLine("eachCornerPix Vy= {0}", Vy); g.FillRectangle(redBrush, Vx, Vy, width, height); } */ // What is there about this for loop that will not run? // When the comments above and after the for loop are removed, it gets an overflow? g.Dispose(); } }

    Read the article

  • How do I catch this WPF Bitmap loading exception?

    - by mmr
    I'm developing an application that loads bitmaps off of the web using .NET 3.5 sp1 and C#. The loading code looks like: try { CurrentImage = pics[unChosenPics[index]]; bi = new BitmapImage(CurrentImage.URI); // BitmapImage.UriSource must be in a BeginInit/EndInit block. bi.DownloadCompleted += new EventHandler(bi_DownloadCompleted); AssessmentImage.Source = bi; } catch { System.Console.WriteLine("Something broke during the read!"); } and the code to load on bi_DownloadCompleted is: void bi_DownloadCompleted(object sender, EventArgs e) { try { double dpi = 96; int width = bi.PixelWidth; int height = bi.PixelHeight; int stride = width * 4; // 4 bytes per pixel byte[] pixelData = new byte[stride * height]; bi.CopyPixels(pixelData, stride, 0); BitmapSource bmpSource = BitmapSource.Create(width, height, dpi, dpi, PixelFormats.Bgra32, null, pixelData, stride); AssessmentImage.Source = bmpSource; Loading.Visibility = Visibility.Hidden; AssessmentImage.Visibility = Visibility.Visible; } catch { System.Console.WriteLine("Exception when viewing bitmap."); } } Every so often, an image comes along that breaks the reader. I guess that's to be expected. However, rather than being caught by either of those try/catch blocks, the exception is apparently getting thrown outside of where I can handle it. I could handle it using global WPF exceptions, like this SO question. However, that will seriously mess up the control flow of my program, and I'd like to avoid that if at all possible. I have to do the double source assignment because it appears that many images are lacking in width/height parameters in the places where the microsoft bitmap loader expects them to be. So, the first assignment appears to force the download, and the second assignment gets the dpi/image dimensions happen properly. What can I do to catch and handle this exception? Stack trace: at MS.Internal.HRESULT.Check(Int32 hr) at System.Windows.Media.Imaging.BitmapFrameDecode.get_ColorContexts() at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation() at System.Windows.Media.Imaging.BitmapImage.OnDownloadCompleted(Object sender, EventArgs e) at System.Windows.Media.UniqueEventHelper.InvokeEvents(Object sender, EventArgs args) at System.Windows.Media.Imaging.LateBoundBitmapDecoder.DownloadCallback(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Application.RunInternal(Window window) at LensComparison.App.Main() in C:\Users\Mark64\Documents\Visual Studio 2008\Projects\LensComparison\LensComparison\obj\Release\App.g.cs:line 48 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

    Read the article

  • Can't connect to smtp (postfix, dovecot) after making a change and trying to change it back

    - by UberBrainChild
    I am using postfix and dovecot along with zpanel and I tried enabling SSL and then turned it off as I did not have SSL configured yet and I realized it was a bit stupid at the time. I am using CentOS 6.4. I get the following error in the mail log. (I changed my host name to "myhostname" and my domain to "mydomain.com") Oct 20 01:49:06 myhostname postfix/smtpd[4714]: connect from mydomain.com[127.0.0.1] Oct 20 01:49:16 myhostname postfix/smtpd[4714]: fatal: no SASL authentication mechanisms Oct 20 01:49:17 myhostname postfix/master[4708]: warning: process /usr/libexec/postfix/smtpd pid 4714 exit status 1 Oct 20 01:49:17 amyhostname postfix/master[4708]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling Reading on forums and similar questions I figured it was just a service that was not running or installed. However I can see that saslauthd is currently up and running on my system and restarting it does not help. Here is my postfix master.cf # # Postfix master process configuration file. For details on the format # of the file, see the Postfix master(5) manual page. # # ***** Unused items removed ***** # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) # ========================================================================== smtp inet n - n - - smtpd # -o content_filter=smtp-amavis:127.0.0.1:10024 # -o receive_override_options=no_address_mappings pickup fifo n - n 60 1 pickup submission inet n - - - - smtpd -o content_filter= -o receive_override_options=no_header_body_checks cleanup unix n - n - 0 cleanup qmgr fifo n - n 300 1 qmgr #qmgr fifo n - n 300 1 oqmgr tlsmgr unix - - n 1000? 1 tlsmgr rewrite unix - - n - - trivial-rewrite bounce unix - - n - 0 bounce defer unix - - n - 0 bounce trace unix - - n - 0 bounce verify unix - - n - 1 verify flush unix n - n 1000? 0 flush proxymap unix - - n - - proxymap smtp unix - - n - - smtp smtps inet n - - - - smtpd # When relaying mail as backup MX, disable fallback_relay to avoid MX loops relay unix - - n - - smtp -o fallback_relay= # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 showq unix n - n - - showq error unix - - n - - error discard unix - - n - - discard local unix - n n - - local virtual unix - n n - - virtual lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache # # ==================================================================== # Interfaces to non-Postfix software. Be sure to examine the manual # pages of the non-Postfix software to find out what options it wants. # ==================================================================== maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - n n - - pipe flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient # # spam/virus section # smtp-amavis unix - - y - 2 smtp -o smtp_data_done_timeout=1200 -o disable_dns_lookups=yes -o smtp_send_xforward_command=yes 127.0.0.1:10025 inet n - y - - smtpd -o content_filter= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o receive_override_options=no_header_body_checks -o smtpd_bind_address=127.0.0.1 -o smtpd_helo_required=no -o smtpd_client_restrictions= -o smtpd_restriction_classes= -o disable_vrfy_command=no -o strict_rfc821_envelopes=yes # # Dovecot LDA dovecot unix - n n - - pipe flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -d ${recipient} # # Vacation mail vacation unix - n n - - pipe flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient} And here is dovecot ## ## Dovecot config file ## listen = * disable_plaintext_auth = no protocols = imap pop3 lmtp sieve auth_mechanisms = plain login passdb { driver = sql args = /etc/zpanel/configs/dovecot2/dovecot-mysql.conf } userdb { driver = sql } userdb { driver = sql args = /etc/zpanel/configs/dovecot2/dovecot-mysql.conf } mail_location = maildir:/var/zpanel/vmail/%d/%n first_valid_uid = 101 #last_valid_uid = 0 first_valid_gid = 12 #last_valid_gid = 0 #mail_plugins = mailbox_idle_check_interval = 30 secs maildir_copy_with_hardlinks = yes service imap-login { inet_listener imap { port = 143 } } service pop3-login { inet_listener pop3 { port = 110 } } service lmtp { unix_listener lmtp { #mode = 0666 } } service imap { vsz_limit = 256M } service pop3 { } service auth { unix_listener auth-userdb { mode = 0666 user = vmail group = mail } # Postfix smtp-auth unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix } } service auth-worker { } service dict { unix_listener dict { mode = 0666 user = vmail group = mail } } service managesieve-login { inet_listener sieve { port = 4190 } service_count = 1 process_min_avail = 0 vsz_limit = 64M } service managesieve { } lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes protocol lda { mail_plugins = quota sieve postmaster_address = [email protected] } protocol imap { mail_plugins = quota imap_quota trash imap_client_workarounds = delay-newmail } lmtp_save_to_detail_mailbox = yes protocol lmtp { mail_plugins = quota sieve } protocol pop3 { mail_plugins = quota pop3_client_workarounds = outlook-no-nuls oe-ns-eoh } protocol sieve { managesieve_max_line_length = 65536 managesieve_implementation_string = Dovecot Pigeonhole managesieve_max_compile_errors = 5 } dict { quotadict = mysql:/etc/zpanel/configs/dovecot2/dovecot-dict-quota.conf } plugin { # quota = dict:User quota::proxy::quotadict quota = maildir:User quota acl = vfile:/etc/dovecot/acls trash = /etc/zpanel/configs/dovecot2/dovecot-trash.conf sieve_global_path = /var/zpanel/sieve/globalfilter.sieve sieve = ~/dovecot.sieve sieve_dir = ~/sieve sieve_global_dir = /var/zpanel/sieve/ #sieve_extensions = +notify +imapflags sieve_max_script_size = 1M #sieve_max_actions = 32 #sieve_max_redirects = 4 } log_path = /var/log/dovecot.log info_log_path = /var/log/dovecot-info.log debug_log_path = /var/log/dovecot-debug.log mail_debug=yes ssl = no Does anyone have any ideas or tips on what I can try to get this working? Thanks for all the help EDIT: Output of postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 2 delay_warning_time = 4 disable_vrfy_command = yes html_directory = no inet_interfaces = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = localhost.$mydomain, localhost mydomain = control.yourdomain.com myhostname = control.yourdomain.com mynetworks = all newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.2.2/README_FILES recipient_delimiter = + relay_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-relay_domains_maps.cf sample_directory = /usr/share/doc/postfix-2.2.2/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_use_tls = no smtpd_client_restrictions = smtpd_data_restrictions = reject_unauth_pipelining smtpd_helo_required = yes smtpd_helo_restrictions = smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_sender_restrictions = smtpd_use_tls = no soft_bounce = yes transport_maps = hash:/etc/postfix/transport unknown_local_recipient_reject_code = 550 virtual_alias_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/zpanel/configs/postfix/virtual_regexp virtual_gid_maps = static:12 virtual_mailbox_base = /var/zpanel/vmail virtual_mailbox_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_domains_maps.cf virtual_mailbox_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_mailbox_maps.cf virtual_minimum_uid = 101 virtual_transport = dovecot virtual_uid_maps = static:101

    Read the article

  • AspxGridView Specified method is not supported. problem

    - by shamim
    Bellow is my .aspx aspxGridview syntax <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" KeyFieldName="intProductCode" onrowinserted="ASPxGridView1_RowInserted"> <Columns> <dx:GridViewCommandColumn VisibleIndex="0"> <EditButton Visible="True"> </EditButton> <NewButton Visible="True"> </NewButton> <DeleteButton Visible="True"> </DeleteButton> </dx:GridViewCommandColumn> <dx:GridViewDataTextColumn Caption="intProductCode" FieldName="intProductCode" VisibleIndex="1"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="strProductName" FieldName="strProductName" VisibleIndex="2"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="SKU" FieldName="SKU" VisibleIndex="3"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="PACK" FieldName="PACK" VisibleIndex="4"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="intQtyPerCase" FieldName="intQtyPerCase" VisibleIndex="5"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="mnyCasePrice" FieldName="mnyCasePrice" VisibleIndex="6"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="intTBQtyPerCase" FieldName="intTBQtyPerCase" VisibleIndex="7"> </dx:GridViewDataTextColumn> <dx:GridViewDataCheckColumn Caption="bIsActive" FieldName="bIsActive" VisibleIndex="8"> </dx:GridViewDataCheckColumn> <dx:GridViewDataTextColumn Caption="intSortingOrder" FieldName="intSortingOrder" VisibleIndex="9"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="strProductAccCode" FieldName="strProductAccCode" VisibleIndex="10"> </dx:GridViewDataTextColumn> </Columns> </dx:ASPxGridView> Bellow is my C# syntax : protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack != true) { BindGridView(); } } private void BindGridView() { DB_OrderV2DataContext db = new DB_OrderV2DataContext(); var r = from p in db.tblProductInfos select p; ASPxGridView1.DataSource = r; ASPxGridView1.DataBind(); } protected void LinqServerModeDataSource1_Selecting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceSelectEventArgs e) { DB_OrderV2DataContext db = new DB_OrderV2DataContext(); var r= from p in db.tblProductInfos select p; e.QueryableSource = r; } protected void ASPxGridView1_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e) { DB_OrderV2DataContext db = new DB_OrderV2DataContext(); tblProductInfo otblProductInfo = new tblProductInfo (); otblProductInfo.intProductCode = (db.tblProductInfos.Max(p => (int?)p.intProductCode) ?? 0) + 1;//oProductController.GenerateProductCode(); otblProductInfo.strProductName = Convert.ToString(e.NewValues["strProductName"]); otblProductInfo.SKU = Convert.ToString(e.NewValues["SKU"]); otblProductInfo.PACK = Convert.ToString(e.NewValues["PACK"]); otblProductInfo.intQtyPerCase = Convert.ToInt32(e.NewValues["intQtyPerCase"]); otblProductInfo.mnyCasePrice = Convert.ToDecimal(e.NewValues["mnyCasePrice"]); otblProductInfo.intTBQtyPerCase = Convert.ToInt32(e.NewValues["intTBQtyPerCase"]); otblProductInfo.bIsActive = Convert.ToBoolean(e.NewValues["bIsActive"]); otblProductInfo.intSortingOrder = (db.tblProductInfos.Max(p => (int?)p.intSortingOrder) ?? 0) + 1;//oProductController.GenerateSortingOrder(); db.tblProductInfos.InsertOnSubmit(otblProductInfo);//the InsertOnSubmit method called in the preceding code was named Add and the DeleteOnSubmit method was named Remove. db.SubmitChanges(); BindGridView(); //oProductController.InsertAndSubmit(); // ASPxGridView1.DataBind(); } My SQL syntax CREATE TABLE [dbo].[tblProductInfo]( [intProductCode] [int] NOT NULL, [strProductName] [varchar](100) NULL, [SKU] [varchar](50) NULL, [PACK] [varchar](50) NULL, [intQtyPerCase] [int] NULL, [mnyCasePrice] [money] NULL, [intTBQtyPerCase] [int] NULL, [bIsActive] [bit] NULL, [intSortingOrder] [int] NULL, [strProductAccCode] [varchar](max) NULL, CONSTRAINT [PK_tblProductInfo] PRIMARY KEY CLUSTERED ( [intProductCode] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] When i want to insert ,show me error message Specified method is not supported. How to solve it.

    Read the article

  • C# Accessing controls from an outside class without "public"

    - by Kurt W
    I know this has been asked before but I believe my situation is a bit different -- or I don't understand the answers given. I have spent about 4 hours working on this solidly and finally realized, I just don't know what to do. I have 2 Forms (Form1, Settings) and a class I created called Themes. I have get/set properties that currently work but are all within Form1 and I would like to move as much code related to themeing as I can OUTSIDE of Form1 and into Themes.cs. Changing Theme: To change the theme, the user opens up the Settings form and selects a theme from the dropdown menu and presses the 'Set' button -- this all works, but now I want to move it into my own class and I can't get the code to compile. Here is example code that works before moving -- note that this is only 2 different controls I want to modify but there are about 30 total. I am abridging the code: Form 1: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btnSettings_Click(object sender, EventArgs e) { Settings frm = new Settings(this); frm.Show(); } private Color txtRSSURLBGProperty; private Color txtRSSURLFGProperty; public Color TxtRSSURLBGProperty { get { return txtRSSURLBGProperty; } set { txtRSSURL.BackColor = value; } } public Color TxtRSSURLFGProperty { get { return txtRSSURLFGProperty; } set { txtRSSURL.ForeColor = value; } } Settings Form: public partial class Settings : Form { public Settings() { InitializeComponent(); } private Form1 rssReaderMain = null; public Settings(Form requestingForm) { rssReaderMain = requestingForm as Form1; InitializeComponent(); } private void button2_Click(object sender, EventArgs args) { // Appearence settings for DEFAULT THEME if (cbThemeSelect.SelectedIndex == 1) { this.rssReaderMain.TxtRSSURLBGProperty = Color.DarkSeaGreen; this.rssReaderMain.TxtRSSURLFGProperty = Color.White; [......about 25 more of these....] } The theme class is currently empty. Again, the goal is to move as much code into the themes class (specifically the get/set statements if at all possible!) and hopefully just use a method similar to this within the Settings form once the proper drowndown item is selected: SetTheme(Default); I hope someone can help, and I hope I explained it right! I have been racking my brain and I need to have this done fairly soon! Much thanks in advance as I'm sure everyone says. I have teamviewer or logmein if someone wants to remote in -- that is just as easy. I can also send my project as a zip if needed. Thanks so much, Kurt Modified code for review: Form1 form: public partial class Form1 : ThemeableForm { public Form1() { InitializeComponent(); } ThemeableForm form: internal abstract class ThemeableForm : Form { private Color rssLabelBGProperty; private Color rssLabelFGProperty; public Color RssLabelBGProperty { get { return rssLabelBGProperty; } set { lRSS.BackColor = value; } } public Color RssLabelFGProperty { get { return rssLabelFGProperty; } set { lRSS.ForeColor = value; } } Settings form: public Settings(ThemeableForm requestingForm) { rssReaderMain = requestingForm as ThemeableForm; InitializeComponent(); } private ThemeableForm rssReaderMain = null; private void button2_Click(object sender, EventArgs args) { // Appearence settings for DEFAULT THEME if (cbThemeSelect.SelectedIndex == 1) { this.rssReaderMain.LRSSBGProperty = Color.DarkSeaGreen; this.rssReaderMain.LRSSFGProperty = Color.White; } Now the all the controls in my get/set (lRSS in the example code above) error out with does not exist in the current context. I also get the warning: Warning 1The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: Form1 --- The base class 'RSSReader_BKRF.ThemeableForm' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. 0 0

    Read the article

  • random generator to obtain data from array not displaying

    - by Yang Jie Domodomo
    I know theres a better solution using arc4random (it's on my to-try-out-function list), but I wanted to try out using the rand() and stand(time(NULL)) function first. I've created a NSMutableArray and chuck it with 5 data. Testing out how many number it has was fine. But when I tried to use the button function to load the object it return me with object <sampleData: 0x9a2f0e0> - (IBAction)generateNumber:(id)sender { srand(time(NULL)); NSInteger number =rand()% ds.count ; label.text = [NSString stringWithFormat:@"object %@", [ds objectAtIndex:number] ]; NSLog(@"%@",label.text); } While I feel the main cause is the method itself, I've paste the rest of the code below just incase i made any error somewhere. ViewController.h #import <UIKit/UIKit.h> #import "sampleData.h" #import "sampleDataDAO.h" @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UILabel *label; @property (weak, nonatomic) IBOutlet UIButton *onHitMePressed; - (IBAction)generateNumber:(id)sender; @property(nonatomic, strong) sampleDataDAO *daoDS; @property(nonatomic, strong) NSMutableArray *ds; @end ViewController.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize label; @synthesize onHitMePressed; @synthesize daoDS,ds; - (void)viewDidLoad { [super viewDidLoad]; daoDS = [[sampleDataDAO alloc] init]; self.ds = daoDS.PopulateDataSource; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [self setLabel:nil]; [self setOnHitMePressed:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } - (IBAction)generateNumber:(id)sender { srand(time(NULL)); NSInteger number =rand()% ds.count ; label.text = [NSString stringWithFormat:@"object %@", [ds objectAtIndex:number] ]; NSLog(@"%@",label.text); } @end sampleData.h #import <Foundation/Foundation.h> @interface sampleData : NSObject @property (strong,nonatomic) NSString * object; @end sampleData.m #import "sampleData.h" @implementation sampleData @synthesize object; @end sampleDataDAO.h #import <Foundation/Foundation.h> #import "sampleData.h" @interface sampleDataDAO : NSObject @property(strong,nonatomic)NSMutableArray*someDataArray; -(NSMutableArray *)PopulateDataSource; @end sampleDataDAO.m #import "sampleDataDAO.h" @implementation sampleDataDAO @synthesize someDataArray; -(NSMutableArray *)PopulateDataSource { someDataArray = [[NSMutableArray alloc]init]; sampleData * myData = [[sampleData alloc]init]; myData.object= @"object 1"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 2"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 3"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 4"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 5"; [someDataArray addObject:myData]; myData=nil; return someDataArray; } @end

    Read the article

  • asp.net listbox

    - by lodun
    Why this code don't work,when i want run this code vwd 2008 express show me this error: Object reference not set to an instance of an object. Line 73: kom.Parameters.Add("@subcategories", SqlDbType.Text).Value = s_categoreis.SelectedItem.ToString(); This is my ascx file: <asp:ListBox ID="categories" runat="server" Height="380px" CssClass="kat" AutoPostBack="true" DataSourceID="SqlDataSource1" DataTextField="Categories" DataValueField="ID" onselectedindexchanged="kategorije_SelectedIndexChanged"></asp:ListBox> <asp:Button ID="Button1" CssClass="my" runat="server" Text="click" onclick="Button1_Click" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:ListBox ID="s_categoreis" CssClass="pod" Height="150px" Enabled="true" runat="server"></asp:ListBox></ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="categories" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:estudent_piooConnectionString %>" SelectCommand="SELECT [ID], [Categories] FROM [categories]"> </asp:SqlDataSource> and this is my ascx.cs: SqlConnection veza; SqlCommand kom = new SqlCommand(); SqlParameter par1 = new SqlParameter(); SqlParameter par2 = new SqlParameter(); SqlParameter par3 = new SqlParameter(); SqlParameter par4 = new SqlParameter(); SqlParameter par5 = new SqlParameter(); SqlParameter par6 = new SqlParameter(); SqlParameter par7 = new SqlParameter(); SqlParameter par8 = new SqlParameter(); SqlParameter par9 = new SqlParameter(); protected void Page_Load(object sender, EventArgs e) { Listapod_kategorije(1); } protected void kategorije_SelectedIndexChanged(object sender, EventArgs e) { Listapod_kategorije(Convert.ToInt32(kategorije.SelectedValue)); } private void Listapod_kategorije(int broj) { SqlDataSource ds = new SqlDataSource(); ds.ConnectionString = ConfigurationManager.ConnectionStrings["estudent_piooConnectionString"].ConnectionString; ds.SelectCommand = "Select * from pod_kategorije where kat_id=" + broj; pod_kategorije.DataSource = ds; pod_kategorije.DataTextField = "pkategorija"; pod_kategorije.DataValueField = "ID"; pod_kategorije.DataBind(); } protected void Button1_Click(object sender, EventArgs e) { Guid jk = new Guid(); object datum = DateTime.Now; veza = new SqlConnection(@"server=85.94.76.170\PADME; database=estudent_pioo;uid=pioo;pwd=1234567"); Random broj = new Random(); int b_kor = broj.Next(1, 1000); kom.Parameters.Add("@text", SqlDbType.Text).Value = str; kom.Parameters.Add("@user", SqlDbType.UniqueIdentifier).Value = jk; kom.Parameters.Add("@date", SqlDbType.DateTime).Value = datum; kom.Parameters.Add("@visits", SqlDbType.Int).Value = 0; kom.Parameters.Add("@answers", SqlDbType.Int).Value = 0; kom.Parameters.Add("@username", SqlDbType.Text).Value = "unknown_" + b_kor.ToString(); ; kom.Parameters.Add("@categories", SqlDbType.Text).Value = categories.SelectedItem.ToString(); kom.Parameters.Add("@sub_categories", SqlDbType.Text).Value = s_categoreis.SelectedItem.ToString(); veza.Open(); kom.ExecuteNonQuery(); veza.Close(); Response.Redirect("default.aspx");

    Read the article

  • How to Print in VS10, Printing gives unhandled exception. Access Denied

    - by Smoka
    Im newish to coding, currently on a Windows Forms App using CLI in VS10 Everything seems to work, my document shows fine in the Preview dialog but then crash's. Heres only the code that seems relevant private: System::Drawing::Printing::PrintDocument^ docPrint; private: System::Windows::Forms::PrintDialog^ dlgPrint; private: System::Windows::Forms::PrintPreviewDialog^ dlgPrintPreview; this->button2 = (gcnew System::Windows::Forms::Button()); this->docPrint = (gcnew System::Drawing::Printing::PrintDocument()); this->dlgPrint = (gcnew System::Windows::Forms::PrintDialog()); this->dlgPrintPreview = (gcnew System::Windows::Forms::PrintPreviewDialog()); this->button2->Location = System::Drawing::Point(152, 355); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(75, 23); this->button2->TabIndex = 53; this->button2->Text = L"Print"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click_1); // // docPrint // this->docPrint->DocumentName = L"ResultsPage"; this->docPrint->PrintPage += gcnew System::Drawing::Printing::PrintPageEventHandler(this, &Form1::docPrint_PrintPage); // // dlgPrint // this->dlgPrint->Document = this->docPrint; this->dlgPrint->UseEXDialog = true; // // dlgPrintPreview // this->dlgPrintPreview->AutoScrollMargin = System::Drawing::Size(0, 0); this->dlgPrintPreview->AutoScrollMinSize = System::Drawing::Size(0, 0); this->dlgPrintPreview->ClientSize = System::Drawing::Size(400, 300); this->dlgPrintPreview->Document = this->docPrint; this->dlgPrintPreview->Enabled = true; this->dlgPrintPreview->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"dlgPrintPreview.Icon"))); this->dlgPrintPreview->Name = L"dlgPrintPreview"; this->dlgPrintPreview->Visible = false; this->dlgPrintPreview->Load += gcnew System::EventHandler(this, &Form1::dlgPrintPreview_Load); private: System::Void docPrint_PrintPage(System::Object^ sender, System::Drawing::Printing::PrintPageEventArgs^ e) { String ^ strDisplay = L"A Axis Rotations"; String ^ strDisplay2 = L"Centerline of Y" + CL_Y->Text + " + Z" + CL_Z->Text; String ^ strDisplay3 = L"Initial Position Y" + G54_Y->Text + " + Z" + G54_Z->Text; System::Drawing::Font ^ fntString = gcnew System::Drawing::Font(L"Times New Roman", 38, FontStyle::Bold); e->Graphics->DrawString(strDisplay, fntString, Brushes::Black, 200,20); e->Graphics->DrawString(strDisplay2, fntString, Brushes::Black, 80,150); e->Graphics->DrawString(strDisplay3, fntString, Brushes::Black, 80,220); e->Graphics->DrawString(Results->Text, fntString,Brushes::Black, 50,400); } private: System::Void button2_Click_1(System::Object^ sender, System::EventArgs^ e) { // docPrint->Print; dlgPrintPreview->ShowDialog(); } private: System::Void dlgPrintPreview_Load(System::Object^ sender, System::EventArgs^ e) { } Sorry if the formatting is ugly here. In case this is all wrong. what is the minimum requirements in code for a print job? Is there an easier way?

    Read the article

  • <optgroup> Not working in jQuery Dropdown

    - by Santhosh Kumar
    I have a asp:dropdownlist which i have changed to jQuery multiselect. I have to group the data inside the dropdown. I am grouping this in runtime.If it is a normal asp dropdown its working. When applying jquery Multiselect its dosen't. Source: <link rel="stylesheet" type="text/css" href="Styles/jquery.multiselect.css" /> <link rel="stylesheet" type="text/css" href="Styles/jquery.multiselect.filter.css" /> <link rel="stylesheet" type="text/css" href="Styles/style.css" /> <link rel="stylesheet" type="text/css" href="Styles/prettify.css" /> <%--<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>--%> <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script> <script type="text/javascript" src="Scripts/jquery.multiselect.js"></script> <script type="text/javascript" src="Scripts/jquery.multiselect.filter.js"></script> <script type="text/javascript" src="Scripts/prettify.js"></script> <script type="text/javascript"> $(document).ready(function () { //Create groups for dropdown list $("option[classification='LessThanFive']").wrapAll("<optgroup label='Less Than Five' />"); $("option[classification='GreaterThanFive']").wrapAll("<optgroup label='Greater Than five' />"); }); </script> <asp:DropDownList ID="MobileData" runat="server" OnDataBound="ddl_DataBound"> </asp:DropDownList> //Code Behind: protected void ddl_DataBound(object sender, EventArgs e) { foreach (ListItem item in ((DropDownList)sender).Items) { if (System.Int32.Parse(item.Value) < 2) item.Attributes.Add("classification", "LessThanFive"); else item.Attributes.Add("classification", "GreaterThanFive"); } } protected void Page_Load(object sender, EventArgs e) { ListItemCollection list = new ListItemCollection(); list.Add(new ListItem("1", "1")); list.Add(new ListItem("2", "2")); list.Add(new ListItem("3", "3")); list.Add(new ListItem("4", "4")); list.Add(new ListItem("5", "5")); list.Add(new ListItem("6", "6")); list.Add(new ListItem("7", "7")); list.Add(new ListItem("8", "8")); list.Add(new ListItem("9", "9")); list.Add(new ListItem("10", "10")); MobileData.DataSource = list; MobileData.DataBind(); } Where i'm wrong?

    Read the article

  • Snake game, can't add new rectangles?

    - by user1814358
    I had seen some problem on other forum, and i tried to solve them but unsuccesfully, now is too intersting for me and i just need to solve this for my ego... lol Main problem is when snake eat first food, snake added one rectangle, when snake eat second food nothings changed? When snake head position and food position are same, then i try to add another rectangle, i have list where i stored rectangles coordinates x and y. What do you think, how i can to solve this problem? I think that i'm so close, but my brain has stopped. :( code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Zmijice { enum Kontrole { Desno,Levo,Gore,Dole,Stoj } public partial class Zmijice : Form { int koox; int kooy; private int x; private int y; private int c; private int b; private const int visina=20; //width private const int sirina=20; //height //private int m = 20; //private int n = 20; private List<int> SegmentX = new List<int>(); private List<int> SegmentY = new List<int>(); Random rnd = new Random(); private Kontrole Pozicija; public Zmijice() { InitializeComponent(); //slucajne pozicije pri startu x = rnd.Next(1, 20) * 20; y = rnd.Next(1, 20) * 20; c = rnd.Next(1, 20) * 20; b = rnd.Next(1, 20) * 20; Pozicija = Kontrole.Stoj; //stop on start } private void Tajmer_Tick(object sender, EventArgs e) { if (Pozicija == Kontrole.Stoj) { //none } if (Pozicija == Kontrole.Desno) { x += 20; } else if (Pozicija == Kontrole.Levo) { x -= 20; } else if (Pozicija == Kontrole.Gore) { y -= 20; } else if (Pozicija == Kontrole.Dole) { y += 20; } Invalidate(); } private void Zmijice_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Down) { Pozicija = Kontrole.Dole; } else if (e.KeyCode == Keys.Up) { Pozicija = Kontrole.Gore; } else if (e.KeyCode == Keys.Right) { Pozicija = Kontrole.Desno; } else if (e.KeyCode == Keys.Left) { Pozicija = Kontrole.Levo; } } private void Zmijice_Paint(object sender, PaintEventArgs e) { int counter = 1; //ako je pojela hranu if (x==c && y==b) { counter++; c = rnd.Next(1, 20); //nova pozicija hrrane c = c * 20; b = rnd.Next(1, 20); b = b * 20; //povecaj zmijicu SegmentX.Add(x); SegmentY.Add(y); //label1.Text = SegmentX.Count().ToString() + " " + SegmentY.Count().ToString(); //left if (Pozicija == Kontrole.Levo) { koox = x+20; kooy = y; } //right if (Pozicija == Kontrole.Desno) { koox = x-20; kooy = y; } //up if (Pozicija == Kontrole.Gore) { koox = x; kooy = y+20; } //down if (Pozicija == Kontrole.Dole) { koox = x; kooy = y-20; } } foreach (int k in SegmentX) { foreach (int l in SegmentY) { e.Graphics.FillRectangle(Brushes.Orange, koox, kooy, sirina, visina); } } koox = x; kooy = y; e.Graphics.FillRectangle(Brushes.DarkRed, x, y, sirina, visina); e.Graphics.FillRectangle(Brushes.Aqua, c, b, sirina, visina); } } }

    Read the article

  • html button elemenents and onserverclick attribute in asp.net

    - by Adrian Adkison
    I have been experiencing some very strange behavior using html buttons with the onserverclick attribute. What I am trying to do is use jQuery to designate the default button on the page. By default button I mean the button that is "clicked" when a user hits enter. In testing, I would hit enter while in an input field and sometimes the intended "default" button was clicked and the server side method defined in the corresponding onserverclick attribute was hit. Other times a post back was made without hitting the server method. In order to isolate the issue I created a minimal test case and found some very interesting results. client side: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" src="/scripts/jquery-1.4.min.js"></script> </head> <body> <form id="form1" runat="server"> <asp:Label ID="_response" runat="server"></asp:Label> <input id="input1" type="text" /> <input id="input2" type="text" /> <button id="first" type="button" class="defaultBtn" runat="server" onserverclick="ServerMethod1">test1</button> <button id="second" type="button" runat="server" onserverclick="ServerMethod2">test2</button> </form> <script type="text/javascript"> jQuery('form input').keyup( function(e) { if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { $('button.defaultBtn').click(); return true; } } ); </script> </body> </html> server side: public partial class admin_spikes_ButtonSubmitTest : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ServerMethod1(object sender, EventArgs e) { _response.Text = "server method1 was hit"; } protected void ServerMethod2(object sender, EventArgs e) { _response.Text = "server method2 was hit"; } } What I found was that everything worked as expected with this code except when I removed one of the input elements. In Firefox 3.6 and IE 8 when only one input exists on the page, hitting enter does not trigger the onserverclick, it makes a post back without even being jQuery "clicked" or actually "clicked". You can test this by starting with two inputs and clicking "test2". This will output "server method2 was hit". Then just hit enter and the output will be "server method1 was hit. Now take away an input and run the same test. Click "test2" see the results, then hit enter and you will see that nothing will change because the "test1" method was never hit. Does anyone know what is going on? Thanks p.s. Chrome worked as expected

    Read the article

  • AsyncPostBackTrigger Just flashing/flicking the UpdatePanel but not updating it

    - by Pankaj
    I am trying UpdatePanel & AsyncPostBackTrigger on master pages through find control method but problem is when I click on button (UpdateButton) It just flash/flick (No Postback) the UpdatePanle but still it don't update or refresh the gridview (images) inside the updatePanel. I have placed script Manger on the master page & an AJAX Update panel in a ContentPlaceHolder in the child page. Also, in another ContentPlaceholder there is an asp button (outside of the UpdatePanel). I want to refresh/reload the AJAX UpdatePanel with this asp button. Thanks for suggestions. Child Page Code :- protected void Page_Load(object sender, EventArgs e) { ScriptManager ScriptManager1 = (ScriptManager)Master.FindControl("ScriptManager1"); ContentPlaceHolder cph = (ContentPlaceHolder)Master.FindControl("cp_Button"); Button btnRefresh = (Button)cph.FindControl("btnRefresh"); ScriptManager1.RegisterAsyncPostBackControl(btnRefresh); } protected void btnRefresh_Click(object sender, EventArgs e) { UpdatePanel1.Update(); } <%@ Page Title="" Language="C#" MasterPageFile="~/InnerMaster.master" AutoEventWireup="true" CodeFile="A.aspx.cs" Inherits="A" Async="true" %> <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Image ID="img12" runat="server" Width="650px" Height="600" ToolTip="A" ImageUrl='<%# Page.ResolveUrl(string.Format("~/Cli/{0}", Eval("image"))) %>' /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> </asp:Content> <asp:Content ID="Content4" ContentPlaceHolderID="cp_Button" Runat="Server"> <asp:Button ID ="btnRefresh" runat="server" onclick="btnRefresh_Click" Height="34" Width="110" Text="More Images" /> </asp:Content> Hi updated code :- Now on click event whole pages is refreshed. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; namespace EProxy { public class EventProxy : Control, IPostBackEventHandler { public EventProxy() { } public void RaisePostBackEvent(string eventArgument) { } public event EventHandler<EventArgs> EventProxied; protected virtual void OnEventProxy(EventArgs e) { if (this.EventProxied != null) { this.EventProxied(this, e); } } public void ProxyEvent(EventArgs e) { OnEventProxy(e); } } } On Master Page Code (btn click):- protected void btnRefresh_Click(object sender, EventArgs e) { ContentPlaceHolder cph = (ContentPlaceHolder)this.FindControl("MainContent"); EventProxy eventProxy = (EventProxy)cph.FindControl("ProxyControl") as EventProxy; eventProxy.ProxyEvent(e); } Web Config :- <pages maintainScrollPositionOnPostBack="true" enableViewStateMac="true"> <controls> <add tagPrefix="it" namespace="EProxy" assembly="App_Code"/> </controls> </pages>

    Read the article

  • SPF record doesn't work (not sure which DNS server to tweak)

    - by Ion
    Problem: Google (and perhaps others) marks our emails as SPF neutral. Let me give you some background about the setup: initially got a dedicated server (Hetzner) with Plesk installed to host a domain/web application, let's say: bigjaws.com. Plesk automatically creates a DNS zone for it with some records for the various services it provides out of the box, e.g. webmail.bigjaws.com as a CNAME to bigjaws.com to provide Horde/whatever, etc. Let me point out four relevant of these records (where XXX.XXX.XXX.158 is our dedicated IP): bigjaws.com. A XXX.XXX.XXX.158 mail.bigjaws.com. A XXX.XXX.XXX.158 bigjaws.com MX (10) mail.bigjaws.com. bigjaws.com. TXT v=spf1 +a +mx -all The above records are not(?) valid anymore though, because after using this dedicated server for a while, our site got bigger and bigger so we decided to move our operations over to AWS (EC2, RDS, ELB, etc), but we retained the mail functionality as is, i.e. emails from [email protected] are sent by connecting to our dedicated server where Plesk takes care of things. This was decided in order not to setup anything from scratch. Of course for all DNS-related things we now use Route53. In Route53 I have the following records: mail.schoox.com. A XXX.XXX.XXX.158 bigjaws.com. MX (10) mail.bigjaws.com bigjaws.com. SPF "v=spf1 +ip4:XXX.XXX.XXX.158 +mx ~all" From my understanding of SPF, the SPF status should have been passed: I designate that all email being sent by bigjaws.com from XXX.XXX.XXX.158 are valid/not spam (I added +mx there but I'm not sure if needed). When a mail server receives an email, doesn't it lookup the SPF record of the domain and checks against the IP it got the email from? Checking with spfquery: root@box:~# spfquery -ip XXX.XXX.XXX.158 -sender [email protected] -rcpt-to [email protected] StartError Context: Failed to query MAIL-FROM ErrorCode: (2) Could not find a valid SPF record Error: No DNS data for 'bigjaws.com'. EndError noneneutral Please see http://www.openspf.org/Why?id=employee1%40bigjaws.com&ip=XXX.XXX.XXX.158&receiver=spfquery : Reason: default spfquery: XXX.XXX.XXX.158 is neither permitted nor denied by domain of bigjaws.com Received-SPF: neutral (spfquery: XXX.XXX.XXX.158 is neither permitted nor denied by domain of bigjaws.com) client-ip=XXX.XXX.XXX.158; [email protected]; If I go to the address listed above (openspf.org) it tells me that the message should have been accepted(!): spfquery rejected a message that claimed an envelope sender address of [email protected]. spfquery received a message from static.158.XXX.XXX.XXX.clients.your-server.de (XXX.XXX.XXX.158) that claimed an envelope sender address of [email protected]. The domain bigjaws.com has authorized static.158.XXX.XXX.XXX.clients.your-server.de (XXX.XXX.XXX.158) to send mail on its behalf, so the message should have been accepted. It is impossible for us to say why it was rejected. What should I do? If the problem persists, contact the bigjaws.com postmaster. Also, here are some headers from an email sent by one of our [email protected] addresses to a gmail.com address (by the way, bigjaws.de listed in the "Received: from" field was the initial domain hosted on the dedicated server before adding the .com one -- both are still listed as separate subscriptions under Plesk). Delivered-To: [email protected] Received: by 10.14.177.70 with SMTP id c46csp289656eem; Wed, 23 Oct 2013 01:11:00 -0700 (PDT) X-Received: by 10.14.102.66 with SMTP id c42mr306186eeg.47.1382515860386; Wed, 23 Oct 2013 01:11:00 -0700 (PDT) Return-Path: <[email protected]> Received: from bigjaws.de (static.158.XXX.XXX.XXX.clients.your-server.de. [XXX.XXX.XXX.158]) by mx.google.com with ESMTPS id l4si19438578eew.161.2013.10.23.01.10.59 for <[email protected]> (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Oct 2013 01:10:59 -0700 (PDT) Received-SPF: neutral (google.com: XXX.XXX.XXX.158 is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=XXX.XXX.XXX.158; Authentication-Results: mx.google.com; spf=neutral (google.com: XXX.XXX.XXX.158 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected] DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bigjaws.com; b=WwRAS0WKjp9lO17iMluYPXOHzqRcOueiQT4rPdvy3WFf0QzoXiy6rLfxU/Ra53jL1vlPbwlLNa5gjoJBi7ZwKfUcvs3s02hJI7b3ozl0fEgJtTPKoCfnwl4bLPbtXNFu; h=Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; Received: (qmail 22722 invoked from network); 23 Oct 2013 10:10:59 +0200 Received: from hostname.static.ISP.com (HELO ?192.168.1.60?) (YYY.YYY.ISP.IP) by static.158.XXX.XXX.XXX.clients.your-server.de. with ESMTPSA (DHE-RSA-AES256-SHA encrypted, authenticated); 23 Oct 2013 10:10:59 +0200 Message-ID: <[email protected]> Date: Wed, 23 Oct 2013 11:11:00 +0300 From: BigJaws Employee <[email protected]> User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: [email protected] Subject: test SPF Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit test SPF Any ideas why SPF is not working correctly? Also, are there any DNS settings that are not needed anymore and create a problem?

    Read the article

  • Ctrl F5 exception and ignored on F5

    - by user575219
    I am getting this unhandled exception error shown: See screen shot. I am getting this error only when I run with Ctrl+ F5 and not in F5(debug mode).Not sure if this is helpful,my computer is a windows 7- 64bit and running a 32 bit build According to this discussion: How can I get WinForms to stop silently ignoring unhandled exceptions?, Adding Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException) iwll cause Windows to ignore the error. EDIT: frmPlant_Load Event public partial class frmPlant : Form { DatabaseConnection _DbConnection = new DatabaseConnection(); string conString = ConfigurationManager.ConnectionStrings["RVESTConnString"].ConnectionString; SQLQueries _SQlQueries = new SQLQueries(); DataSet ds; SQLiteDataAdapter da; static DataTable gdt; int gSelectedPlant; string gSelectedPlantName = ""; bool ignoreSelChg = false; bool DataDirty = false; public frmPlant() { InitializeComponent(); } public frmPlant(int sSelectedPlant) { InitializeComponent(); } private void frmPlant_Load(object sender, EventArgs e) { ds = FillData(); gdt = ds.Tables[0]; bindingSource1.DataSource = gdt; dataGridView1.DataSource = bindingSource1; gSelectedPlant = StaticClass.GlobalValue; dataGridView1.AutoGenerateColumns = true; dataGridView1.Columns["PlantId"].Visible = false; dataGridView1.Columns["NSSS_Design"].Width = 70; } private DataSet FillData() { ignoreSelChg = true; SQLiteConnection con = new SQLiteConnection(conString); DataSet dPlant; try { con.Open(); SQLiteCommand cmd = new SQLiteCommand("select * from Plant", con); da = new SQLiteDataAdapter("select * from Plant", con); dPlant = new DataSet(); da.Fill(dPlant, "plant"); } catch (Exception ex) { throw ex; } finally { con.Close(); } return dPlant; } I should also add another concern: When I say continue here in the dialog, it works fine but leaves a background process running. I have to manually go and kill it in the task manager Question: Suppose I add this line in the Program.cs, will it ignore ANY- even genuine errors which need to be fixed? More Code: This dialog pops up on button click on the second screen- Initial Setup screen . The first being a splash screen. Initial setup takes me to the Plant form Here's the code for the initial setup screen public partial class frmInitialSetUp : Form { public frmInitialSetUp() { InitializeComponent(); } private void btnOK_Click(object sender, EventArgs e) { Program.fPlant = new frmPlant(); Program.fPlant.Show(); this.Hide(); } private void frmInitialSetUp_Load(object sender, EventArgs e) { Program.LoadAllForms(); } } } Program.cs static public void LoadAllForms() { try { Program.fInitialSetUp = new frmInitialSetUp(); Program.fPlant = new frmPlant(); Program.frm*** = new frm***(); Program.frm*** = new frm***(); Program.frm*** = new frm***(); } catch (Exception ex) { throw ex; } } On button click on the

    Read the article

  • Memory management in iphone cocos2d

    - by muthu
    i am iphone developer very new to this field....i am developing a ebook app in iphone using cocos2d...i use more than 150 images(i guess) the problem while turning from one page to another images get hanged randomly...... i tried this also [[TextureMgr sharedTextureMgr] removeAllTextures]; but went in vain...i guess the the problem is with the memory.....this my coding for all the pages -(id)init { if( (self=[super init] )) { self.isTouchEnabled = YES; [SimpleAudioEngine sharedEngine]; NSLog(@"b4 cover"); Sprite *bg1 = [Sprite spriteWithFile:@"a.jpg"]; bg1.anchorPoint = CGPointZero; [self addChild:bg1 z:-1]; once = TRUE; soundId = [[SimpleAudioEngine sharedEngine] playEffect:@".mp3"]; } return self; } -(void) transitionfront:(id) sender { [[SimpleAudioEngine sharedEngine] stopEffect:soundId]; soundId1 = [[SimpleAudioEngine sharedEngine] playEffect:@"page_turn.mp3"]; flip = [[Sprite spriteWithFile:@"a.jpg"] retain]; [self addChild: flip z:1]; [flip setPosition:ccp(160,240)]; Animation* animation1 = [Animation animationWithName:@"Page1" delay:0.09]; for( int i=1;i<4;i++) [animation1 addFrameWithFilename: [NSString stringWithFormat:@".jpg", i]]; id action = [Animate actionWithAnimation: animation1]; //id action = [RepeatForever actionWithAction:[Animate actionWithAnimation: animation1]]; [flip runAction:action]; [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(moveforward) userInfo:nil repeats:NO]; } -(void) moveforward { [[SimpleAudioEngine sharedEngine] stopEffect:soundId1]; [[Director sharedDirector] replaceScene: [ [Scene node] addChild: [nextpage node] z:0] ]; } -(void) transitionback:(id) sender { [[SimpleAudioEngine sharedEngine] stopEffect:soundId]; soundId1 = [[SimpleAudioEngine sharedEngine] playEffect:@".mp3"]; flip = [[Sprite spriteWithFile:@".jpg"] retain]; [self addChild: flip z:1]; [flip setPosition:ccp(160,240)]; Animation* animation1 = [Animation animationWithName:@"Page1" delay:0.09]; for( int i=3;i>0;i--) [animation1 addFrameWithFilename: [NSString stringWithFormat:@".jpg", i]]; id action = [Animate actionWithAnimation: animation1]; //id action = [RepeatForever actionWithAction:[Animate actionWithAnimation: animation1]]; [flip runAction:action]; [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(movebackward) userInfo:nil repeats:NO]; } -(void) movebackward{ //[[SimpleAudioEngine sharedEngine]stopEffect:@".mp3"]; [[Director sharedDirector]replaceScene:[[Scene node]addChild:[b4page node] z:0]]; } -(void) glossary :(id) sender { [[SimpleAudioEngine sharedEngine]stopEffect:soundId]; [[Director sharedDirector]replaceScene:[[Scene node]addChild:[ node] z:0]]; } -(BOOL)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint cocosTouchPoint = [touch locationInView: [touch view]]; CGPoint point = [[Director sharedDirector] convertToGL:cocosTouchPoint]; NSLog(@"pointx: %f pointy:%f", point.x, point.y); // Was a tab touched, if so, which one... if (CGRectContainsPoint(CGRectMake(220, 0, 100, 70), point)) { if(once) { NSLog(@"enterred page1"); [self transitionfront:nil]; once = FALSE; } } if (CGRectContainsPoint(CGRectMake(0,0,60,60), point)) { if(once) { NSLog(@"enterred cover"); [self transitionback:nil]; once = FALSE; } } if (CGRectContainsPoint(CGRectMake(100, 15, 30, 30), point)) { if(once){ [self glossary :nil]; once = FALSE; } } return kEventHandled; } -(void)playEffect:(NSString*)sound{ if(effectPlayer!=nil){ [effectPlayer release]; } NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:sound ofType:@"mp3"]]; effectPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil]; [effectPlayer setDelegate:self]; [effectPlayer play]; } -(void)stopEffect { [effectPlayer stop]; } -(void) dealloc{ [super dealloc]; } do pls help me........ do give me a exact coding this is the err..... *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: aesop.mp3)' 2010-05-27 10:43:09.834 abc[276:20b] Stack: ( 11674715, 2476006971, 11758651, 11758490, 5126917, 660698, 660881, 661061, 131577, 448857, 120432, 153433, 630890, 23694899, 23603228, 23630005, 47120081, 11459456, 11455560, 47114125, 47114322, 23633923, 9928, 9814 )

    Read the article

  • How to log out from the Facebook in windows phone 7 using facebook api?

    - by Vijay
    I am trying to add Facebook into my application. I have try with a sample. public class FacebookLoginPageViewModel { private static WebBrowser _webBrowser; private Page _page; private const string ExtendedPermissions = "user_about_me,read_stream,publish_stream,user_birthday,offline_access,email"; private readonly FacebookClient _fb = new FacebookClient(); private const string AppId = "1XXX58XXXXXXXX9"; Uri url; public FacebookLoginPageViewModel(Panel container, Page page) { _page = page; _webBrowser = new WebBrowser(); var loginUrl = GetFacebookLoginUrl(AppId, ExtendedPermissions); url = loginUrl; container.Children.Add(_webBrowser); _webBrowser.Navigated += webBrowser_Navigated; _webBrowser.Navigate(loginUrl); } private Uri GetFacebookLoginUrl(string appId, string extendedPermissions) { var parameters = new Dictionary<string, object>(); parameters["client_id"] = appId; parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html"; parameters["response_type"] = "token"; parameters["display"] = "touch"; // add the 'scope' only if we have extendedPermissions. if (!string.IsNullOrEmpty(extendedPermissions)) { // A comma-delimited list of permissions parameters["scope"] = extendedPermissions; } return _fb.GetLoginUrl(parameters); } void webBrowser_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e) { FacebookOAuthResult oauthResult; if (!_fb.TryParseOAuthCallbackUrl(e.Uri, out oauthResult)) { return; } if (oauthResult.IsSuccess) { var accessToken = oauthResult.AccessToken; LoginSucceded(accessToken); } else { // user cancelled MessageBox.Show(oauthResult.ErrorDescription); } } private void LoginSucceded(string accessToken) { var fb = new FacebookClient(accessToken); fb.GetCompleted += (o, e) => { if (e.Error != null) { Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.Message); return; }); } var result = (IDictionary<string, object>)e.GetResultData(); var id = (string)result["id"]; var url = string.Format("/Views/FacebookInfoPage.xaml?access_token={0}&id={1}", accessToken, id); var rootFrame = (App.Current as App).RootFrame; Deployment.Current.Dispatcher.BeginInvoke(() => { rootFrame.Navigate(new Uri(url, UriKind.Relative)); }); }; fb.GetAsync("me?fields=id"); } This is working fine. But i want to Log out from the facebook when i click log out. How to achieve this? I have try with some examples. But it is not working for me. private void logout(object sender, RoutedEventArgs e) { webBrowser1.Navigated += new EventHandler<System.Windows.Navigation.NavigationEventArgs>(CheckForout); webBrowser1.Navigate(new Uri("http://m.facebook.com/logout.php?confirm=1")); webBrowser1.Visibility = Visibility.Visible; } private void CheckForout(object sender, System.Windows.Navigation.NavigationEventArgs e) { string fbLogoutDoc = webBrowser1.SaveToString(); Regex regex = new Regex ("\\<a href=\\\"/logout(.*)\\\".*data-sigil=\\\"logout\\\""); MatchCollection matches = regex.Matches(fbLogoutDoc); if (matches.Count > 0) { string finalLogout = string.Format("http://m.facebook.com/logout{0}", matches[0].Groups[1].ToString().Replace("amp;", "")); webBrowser1.Navigate(new Uri(finalLogout)); } } Please let me any idea to resolve this problem.

    Read the article

  • Selected Index Changed event not firing both Autopostback property

    - by TechGuy
    In my Dropdownlist Selected index change event not firing.Here i use auto post back true & View state also true.But Selected Index Changed Event not firing My Code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdminEagleViewLogin.aspx.cs" Inherits="AdminEagleViewLogin" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <style> body{padding-top:20px;} </style> <title></title> </head> <body> <form id="form1" runat="server"> <div class="container"> <div class="row"> User : <asp:DropDownList ID="drpusr" runat="server" Visible="true" OnSelectedIndexChanged="drpusr_SelectedIndexChanged" AutoPostBack="true" EnableViewState="true" ></asp:DropDownList> Password: <asp:Label ID="lbluserpw" runat="server"></asp:Label> <div class="col-md-4 col-md-offset-4"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Please sign in</h3> </div> <div class="panel-body"> <form accept-charset="UTF-8" role="form"> <fieldset> <div class="form-group"> <asp:TextBox ID="txtusr" runat="server"></asp:TextBox> </div> <div class="form-group"> <asp:TextBox ID="txtpw" runat="server" TextMode="Password"></asp:TextBox> </div> <div class="checkbox"> <label> <input name="remember" type="checkbox" value="Remember Me"> Remember Me </label> </div> <asp:CheckBox ID="chkremember" runat="server" Visible="false" class="remchkbox" /> <asp:Button ID="submit" runat="server" class="btn btn-lg btn-success btn-block" Text="Submit" OnClick="submit_Click" /> </fieldset> </form> </div> </div> </div> </div> </div> </form> </body> </html> ServerSide User bind to Dropdown is working. public partial class AdminEagleViewLogin : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { BindUsers(); //lbluserpw.Text = Membership.Provider.GetPassword(drpusr.SelectedValue, String.Empty); } protected void submit_Click(object sender, EventArgs e) { if (Membership.ValidateUser(txtusr.Text, txtpw.Text)) { FormsAuthentication.SetAuthCookie(txtusr.Text, chkremember.Checked); string[] CurrentUserRole = Roles.GetRolesForUser(txtusr.Text); var admin = "Administrator"; var manager = "Manager"; var user = "User"; if (CurrentUserRole.Contains(admin)) { Response.Redirect("Administrator.aspx"); } else if (CurrentUserRole.Contains(manager)) { Response.Redirect("Manager.aspx"); } else { Response.Redirect("UserPage.aspx"); } } else { Response.Redirect("AdminEagleViewLogin.aspx"); } } protected void BindUsers() { DataAccess da = new DataAccess(); drpusr.DataSource = da.GetUsers(); drpusr.DataTextField = "UserName"; drpusr.DataValueField = "UserId"; drpusr.DataBind(); drpusr.Items.Insert(0, new ListItem("-- Select User --", "0")); drpusr.Items.RemoveAt(1); } protected void drpusr_SelectedIndexChanged(object sender, EventArgs e) { lbluserpw.Text = Membership.Provider.GetPassword(drpusr.SelectedValue, String.Empty); } }

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >