Search Results

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

Page 43/174 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • pagination for displaytag with colorbox in Spring framework

    - by Hitesh Solanki
    Hi..... I want to display the pop up for user selection using colorbox. I have put link on manageblacklist.jsp named 'select'. when I click on 'select' link ,colorbox is displayed. all user is displayed but pagination is not worked. I have used display tag for pagination. Without using colorbox, pagination is worked fine. I have used spring framework. The code of manageblacklist.jsp is given below: <%@ page contentType="text/html" pageEncoding="UTF-8" import="java.util.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ include file="/WEB-INF/jsp/include.jsp" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ taglib uri="http://displaytag.sf.net" prefix="display" %> <%@ page import="com.sufalam.mailserver.bean.User"%> <%@ page import="javax.servlet.http.HttpSession" %> <% String pageSize = (String) request.getAttribute("pageSize"); System.out.println("page size:" + pageSize); HttpSession session1 = request.getSession(); List<User> userList = (List<User>) session1.getAttribute("userList"); Iterator iterator = userList.iterator(); String user = (String) request.getAttribute("user"); System.out.println("user in the jsp :" + user); %> <html> <head> <script type="text/javascript" src="js/jquery142.js"></script> <script type="text/javascript" src="js/jquery.colorbox.js"></script> <link rel="stylesheet" href="style/colorbox.css" type="text/css"> <script type="text/javascript"> $(document).ready(function(){ //Examples of how to assign the ColorBox event to elements $(".example5").colorbox(); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here."); return false; }); }); </script> <script type="text/javascript"> function changePageSize() { var myValue = document.getElementById("combo1").value; document.getElementById("selectedPageSize").value=myValue; document.whitelistBlacklistForm.submit(); } function selectAll() { var selectAll = document.getElementById("checkAll"); var returnById = document.getElementsByName("check"); var i; var val; if (selectAll.checked == true) { val = true; } else { val = false; } for (i = 0; i < returnById.length; i++) { returnById[i].checked = val; } } function onload() { insertNavigation ('insertHereTop', 'insertHereBottom'); } function insertNavigation( topElementID, BottomElementID ) { if ( document.getElementById('pagingBanner') ){ document.getElementById(topElementID).innerHTML=document.getElementById('pagingBanner').innerHTML; document.getElementById(BottomElementID).innerHTML=document.getElementById('pagingBanner1').innerHTML; } } function confirmDelete() { if (confirm("Are you sure you want to delete selected records?")) { flag = 1; return true; } else { return false; } } function loadModels() { var flag=true; var textValue = document.getElementById('txtuser'); $.getJSON("ajaxblacklist.htm", // url { param :textValue.value }, // request params function(json) { // callback // var options = '<table class="displayTable" cellspacing="0"><thead><tr><th align = "center">Blacklisted Sender</th>'+ // '<th align ="center">Delete</th></tr></thead><tbody>'; var options = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="background:url(images/leftbg.gif) repeat-y; width:8px;"></td>' + '<td class="middlesection"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>' + '<td height="30" class="p10"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="allboder" >' + '<tr><td class="tebelhd"> Blacklisted Sender </td></tr>'; for (i in json) { var state = json[i]; for(j in state){ var op = state[j]; if(op.length==undefined){ options += '<tr><td class="tdhd"><table width="0%" border="0" cellspacing="0" cellpadding="0"><tr><td width="741">'+ state[j].senderEmail + '</td><td align="center" width="148"><a href="managewhitelistblacklist.htm?sender='+state[j].senderEmail+'&recipient='+ state[j].recipientEmail+'&action=delete"><span> <img src="/MailServerV2/images/delete.gif"/> </span></a></td></tr></table></td></tr>'; break; } for(k in op) { if(flag == true) { flag = false; options += '<tr><td class="tdhd"><table width="0%" border="0" cellspacing="0" cellpadding="0"><tr>'; } else { flag = true; options += '<tr><td class="tdhd2"><table width="0%" border="0" cellspacing="0" cellpadding="0"><tr>'; } options += '<td width="741">'+ op[k].senderEmail +'</td><td align="center" width="148"><a href="managewhitelistblacklist.htm?sender='+op[k].senderEmail+'&recipient='+op[k].recipientEmail+'&action=delete"><span> <img src="/MailServerV2/images/delete.gif"/> </span></a></td></tr></table></td></tr>'; } } } options += '</td></tr></table>'; $("div[name^=blacklist]").html(options); }); } </script> </head> <body> <table width="" border="0" align="center" cellpadding="0" cellspacing="0" class="maintable"> <tr> <td class="topsection"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" align="center" class="middlesection" ><table width="96%" border="0" cellspacing="0" cellpadding="0"> <tr> <td >&nbsp;</td> </tr> <tr> <td> <table width="100%" border="0" cellspacing ="0" cellpadding="0"> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td align="left" valign="middle"><h1>Manage Blacklist</h1></td> <td align="right" valign="bottom"><div style="float:right;"><a href="savewhitelistblacklist.htm" class="buttonash"><span>Create Whitelist Blacklist </span></a></div></td> </tr> </table></td> </tr> <tr> <td class="bottomboder"><img src="images/ashish.gif" height="1" /></td> </tr> </table> </td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td> </td> </tr> <tr> <td> <div id="TabbedPanels1" class="TabbedPanels"/> <div style="display: block;" class="TabbedPanelsContent"/> <div align="left" class="tebelhd"> Blacklist Information </div><div class="entry-edit"> <div class="fieldset" id="base_fieldset"> <div class="hor-scroll_1" align="left"> <fieldset Class="label1css" style="color:#666666"> <legend>Fields</legend> <table> <tr> <td align="right"> Recipient Email : </td> <td><input type="text" id="txtuser" name="txtuser" <% if (user != null) { %> value="<%=user%>" <% } else { %> value="" <% } %> /> </td> <td><a href="#" class="buttonash" onclick="loadModels()"><span>Search</span></a></td> <!-- <td><a href="javascript:void(0)" class="buttonash" onclick="window.open('selectuser.htm','selectuser','width=600,height=400,menubar=yes,status=yes,location=yes,toolbar=yes,scrollbars=yes');" ><span>Select</span></a></td>--> <td><a href="selectuser.htm" class="example5 buttonash" ><span>Select</span></a> </td> <td align="right"> </td> </tr> </table> </fieldset> <div id="blacklist" name="blacklist"></div> </div> </div> </div> </td> </tr> </table> </td> </tr> </table> </td> <!-- InstanceEndEditable --> <td style="background:url(images/rightbg.gif) repeat-y; width:8px;"></td> </tr> </table> <% // session1.removeAttribute("user"); %> </body> </html> So , please tell me how to work pagination .... Thanks in advanced...

    Read the article

  • Gridview sorting: SortDirection always Ascending

    - by Julien N
    Hi ! I have a gridview and I need to sort its elements when the user clicks on the header. Its datasource is a List object. The aspx is defined this way : <asp:GridView ID="grdHeader" AllowSorting="true" AllowPaging="false" AutoGenerateColumns="false" Width="780" runat="server" OnSorting="grdHeader_OnSorting" EnableViewState="true"> <Columns> <asp:BoundField DataField="Entitycode" HeaderText="Entity" SortExpression="Entitycode" /> <asp:BoundField DataField="Statusname" HeaderText="Status" SortExpression="Statusname" /> <asp:BoundField DataField="Username" HeaderText="User" SortExpression="Username" /> </Columns> </asp:GridView> The code behind is defined this way : First load : protected void btnSearch_Click(object sender, EventArgs e) { List<V_ReportPeriodStatusEntity> items = GetPeriodStatusesForScreenSelection(); this.grdHeader.DataSource = items; this.grdHeader.DataBind(); } when the user clicks on headers : protected void grdHeader_OnSorting(object sender, GridViewSortEventArgs e) { List<V_ReportPeriodStatusEntity> items = GetPeriodStatusesForScreenSelection(); items.Sort(new Helpers.GenericComparer<V_ReportPeriodStatusEntity>(e.SortExpression, e.SortDirection)); grdHeader.DataSource = items; grdHeader.DataBind(); } My problem is that e.SortDirection is always set to Ascending. I have webpage with a similar code and it works well, e.SortDirection alternates between Ascending and Descending. What did I do wrong ?

    Read the article

  • django+uploadify - don't working

    - by Erico
    Hi, I'm trying to use an example posted on the "github" the link is http://github.com/tstone/django-uploadify. And I'm having trouble getting work. can you help me? I followed step by step, but does not work. Accessing the "URL" / upload / the only thing is that returns "True" part of settings.py import os PROJECT_ROOT_PATH = os.path.dirname(os.path.abspath(file)) MEDIA_ROOT = os.path.join(PROJECT_ROOT_PATH, 'media') TEMPLATE_DIRS = ( os.path.join(PROJECT_ROOT_PATH, 'templates')) urls.py from django.conf.urls.defaults import * from django.conf import settings from teste.uploadify.views import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), url(r'upload/$', upload, name='uploadify_upload'), ) views.py from django.http import HttpResponse import django.dispatch upload_received = django.dispatch.Signal(providing_args=['data']) def upload(request, *args, **kwargs): if request.method == 'POST': if request.FILES: upload_received.send(sender='uploadify', data=request.FILES['Filedata']) return HttpResponse('True') models.py from django.db import models def upload_received_handler(sender, data, **kwargs): if file: new_media = Media.objects.create( file = data, new_upload = True, ) new_media.save() upload_received.connect(upload_received_handler, dispatch_uid='uploadify.media.upload_received') class Media(models.Model): file = models.FileField(upload_to='images/upload/', null=True, blank=True) new_upload = models.BooleanField() uploadify_tags.py from django import template from teste import settings register = template.Library() @register.inclusion_tag('uploadify/multi_file_upload.html', takes_context=True) def multi_file_upload(context, upload_complete_url): """ * filesUploaded - The total number of files uploaded * errors - The total number of errors while uploading * allBytesLoaded - The total number of bytes uploaded * speed - The average speed of all uploaded files """ return { 'upload_complete_url' : upload_complete_url, 'uploadify_path' : settings.UPLOADIFY_PATH, # checar essa linha 'upload_path' : settings.UPLOADIFY_UPLOAD_PATH, } template - uploadify/multi_file_upload.html {% load uploadify_tags }{ multi_file_upload '/media/images/upload/' %} <script type="text/javascript" src="{{ MEDIA_URL }}js/swfobject.js"></script> <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.uploadify.js"></script> <div id="uploadify" class="multi-file-upload"><input id="fileInput" name="fileInput" type="file" /></div> <script type="text/javascript">// <![CDATA[ $(document).ready(function() { $('#fileInput').uploadify({ 'uploader' : '/media/swf/uploadify.swf', 'script' : '{% url uploadify_upload %}', 'cancelImg' : '/media/images/uploadify-remove.png/', 'auto' : true, 'folder' : '/media/images/upload/', 'multi' : true, 'onAllComplete' : allComplete }); }); function allComplete(event, data) { $('#uploadify').load('{{ upload_complete_url }}', { 'filesUploaded' : data.filesUploaded, 'errorCount' : data.errors, 'allBytesLoaded' : data.allBytesLoaded, 'speed' : data.speed }); // raise custom event $('#uploadify') .trigger('allUploadsComplete', data); } // ]]</script>

    Read the article

  • Postback problem when using URL Rewrite and 404.aspx

    - by salle55
    I'm using URL rewrite on my site to get URLs like: http://mysite.com/users/john instead of http://mysite.com/index.aspx?user=john To achive this extensionless rewrite with IIS6 and no access to the hosting-server I use the "404-approach". When a request that the server can't find, the mapped 404-page is executed, since this is a aspx-page the rewrite can be performed (I can setup the 404-mapping using the controlpanel on the hosting-service). This is the code in Global.asax: protected void Application_BeginRequest(object sender, EventArgs e) { string url = HttpContext.Current.Request.Url.AbsolutePath; if (url.Contains("404.aspx")) { string[] urlInfo404 = Request.Url.Query.ToString().Split(';'); if (urlInfo404.Length > 1) { string requestURL = urlInfo404[1]; if (requestURL.Contains("/users/")) { HttpContext.Current.RewritePath("~/index.aspx?user=" + GetPageID(requestURL)); StoreRequestURL(requestURL); } else if (requestURL.Contains("/picture/")) { HttpContext.Current.RewritePath("~/showPicture.aspx?pictureID=" + GetPageID(requestURL)); StoreRequestURL(requestURL); } } } } private void StoreRequestURL(string url) { url = url.Replace("http://", ""); url = url.Substring(url.IndexOf("/")); HttpContext.Current.Items["VirtualUrl"] = url; } private string GetPageID(string requestURL) { int idx = requestURL.LastIndexOf("/"); string id = requestURL.Substring(idx + 1); id = id.Replace(".aspx", ""); //Only needed when testing without the 404-approach return id; } And in Page_Load on my masterpage I set the correct URL in the action-attribute on the form-tag. protected void Page_Load(object sender, EventArgs e) { string virtualURL = (string)HttpContext.Current.Items["VirtualUrl"]; if (!String.IsNullOrEmpty(virtualURL)) { form1.Action = virtualURL; } } The rewrite works fine but when I perform a postback on the page the postback isn't executed, can this be solved somehow? The problem seems to be with the 404-approach because when I try without it (and loses the extensionless-feature) the postback works. That is when I request: http://mysite.com/users/john.aspx Can this be solved or is there any other solution that fulfil my requirements (IIS6, no serveraccess/ISAPI-filter and extensionless).

    Read the article

  • UIImage cropping on user selected rectangle in iphone?

    - by Rajendra Bhole
    Hi, I developing an small application in which i want to crop the UIImage captured by imagePickerControllerSourceTypeOfCamera. The UIImage should crop by user selected crop area or cropped rectangle. That means first user capture the image from the camera.Then on captured image the user selected an rectangle having color gray.That image(image data) should crop from that gray colored rectangle. My under develop code is as follows. -(IBAction) getPhoto:(id)sender { UIImagePickerController* imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; if((UIButton *) sender == btnphotoAlbum) { imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; } else { imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; } imagePickerController.allowsImageEditing = YES; //imagePickerController.toolbar.barStyle =UIBarStyleBlackOpaque; //UIToolbar *toolBar=[[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 20, 320)]; //imagePickerController. [self presentModalViewController:imagePickerController animated:YES]; } (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { UIImage *selectedImage = image; UIImage *originalImage = [editingInfo objectForKey:@"UIImagePickerControllerOriginalImage"]; NSValue *cropRect = [editingInfo objectForKey:UIImagePickerControllerCropRect]; CGRect theRect = [cropRect CGRectValue]; //captureImage.image =[info objectForKey:@"UIImagePickerControllerOriginalImage"]; [picker dismissModalViewControllerAnimated:YES]; } How i crop the image?

    Read the article

  • Integrating Dynamics CMS with Sharepoint ASCX SecurityException Issue

    - by Gavin
    Hi, I've an ASCX control (WebParts aren't used in this solution) which interrogates CMS 4's data via the API provided by Microsoft.Crm.Sdk and Microsoft.Crm.SdkTypeProxy. The solution works until it's deployed to Sharepoint. Initially I received the following error: [SecurityException: That assembly does not allow partially trusted callers.] MyApp.SharePoint.Web.Applications.MyAppUtilities.RefreshUserFromCrm(String login) +0 MyApp.SharePoint.Web.Applications.MyApp_LoginForm.btnLogin_Click(Object sender, EventArgs e) +30 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 Then I tried wrapping the calling code in the ASCX with SPSecurity.RunWithElevatedPrivileges: SPSecurity.RunWithElevatedPrivileges(delegate() { // FBA user may not exist yet or require refreshing MyAppUtilities.RefreshUserFromCrm(txtUser.Text); }); But this resulted in the following error: [SecurityException: Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.] MyApp.SharePoint.Web.Applications.MyApp_LoginForm.btnLogin_Click(Object sender, EventArgs e) +0 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 When I elevate the trust level in the Sharepoint site to full everything works fine, however I need to come up with a solution that uses minimal trust (or a customised minimal trust). I'm also trying to stay clear of adding anything to the GAC. Any ideas? I assume the issue is occuring when trying to call functionality from Microsoft.Crm.* Thanks in advance for any help anyone can provide. Cheers, Gavin

    Read the article

  • Find, Find Next?

    - by Tanner
    Hello everyone, I am trying to make a find, find next function for my program, which I did manage to do with this code: int findPos = 0; private void button1_Click(object sender, EventArgs e) { try { string s = textBox1.Text; richTextBox1.Focus(); findPos = richTextBox1.Find(s, findPos, RichTextBoxFinds.None); richTextBox1.Select(findPos, s.Length); findPos += textBox1.Text.Length; //i = richTextBox1.Find(s, i + s.Length, RichTextBoxFinds.None); } catch { MessageBox.Show("No Occurences Found"); findPos = 0; } } And it works great in form1 but if I use this code and try to call it from form2 It doesn't do anything: //Form1 public void FindNext() { try { this.Focus(); Form2 frm2 = new Form2(); string s = frm2.textBox1.Text; richTextBox1.Focus(); findPos = richTextBox1.Find(s, findPos, RichTextBoxFinds.None); richTextBox1.Select(findPos + 1, s.Length); findPos += textBox1.Text.Length; } catch { MessageBox.Show("No Occurences Found"); findPos = 0; } } //Form2 private void button1_Click(object sender, EventArgs e) { Form1 frm1 = new Form1(); frm1.FindNext(); } Does any one know why this is? Thanks,Tanner.

    Read the article

  • Telerik RadAlert back button cache problem

    - by Michael VS
    Hi, I'm sure you have had this one before so if you could point me to something similar.... I have a server side creation of a RadAlert window using the usual Sys.Application.remove_load and add_load procedure however the alert keeps popping up as it seems to be caching when the user hits the back button after it has been activated. I have tried to put a onclick event on a button to clear the function using remove_load before it moves to the next page however it still doesn't seem to clear it. Its used in validation so if a user inputs failed validation it pops up. If they then go and enter correct validation it then moves onto the next page. If they then use back button this is where it pops up again. Any ideas? Server side: private void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { btnSearch.Attributes.Add("onclick", "Sys.Application.remove_load(f);"); } } private void btnSearch_Click(object sender, System.EventArgs e) { string radalertscript = "(function(){var f = function(){radalert('Welcome to RadWindow Prometheus!', 330, 210); Sys.Application.remove_load(f);};Sys.Application.add_load(f);})()"; RadAjaxManager1.ResponseScripts.Add(radalertscript); } Ive also tried using RadAjaxManager1.ResponseScripts.Clear(); before it moves on to the next page on the postback event

    Read the article

  • Save UIwebview contents to photo gallery

    - by user307410
    There's a video tutorial on u tube that shows how to perform this.It consists of a UIwebview and toolbar button to save the contents.Haven't had any luck making this work.Could someone have a look and see they can make it work.Many thanks in advance. http://www.youtube.com/watch?v=gDPca3JIc_s&feature=player_embedded# /////////////////////////////////////////////////////////////////// // // SaveWebViewController.h // SaveWeb // // // Copyright MyCompanyName 2010. All rights reserved. // import @interface SaveWebViewController : UIViewController { IBOutlet UIWebView *webview; } @property (nonatomic, retain) IBOutlet UIWebView *webview; [IBAction]saveWeb:(id)sender; @end //////////////////////////////////////////////////////////////////////////////// // // SaveWebViewController.m // SaveWeb // // // Copyright MyCompanyName 2010. All rights reserved. // import "SaveWebViewController.h" @implementation SaveWebViewController (IBAction)saveWeb:(id)sender { UIGraphicsBeginImageContext(webView.frame.size); [self.view.layer renderInContext: UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil); } // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } //Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://google.com"]]]; } // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } (void)dealloc { [super dealloc]; } @end

    Read the article

  • Dismiss Popover using Unwind Segue in Xcode Storyboard

    - by AlexR
    I am using Xcode 4.5 and the new iOS 6 feature to unwind segues. I am presenting a navigation view controller inside a popover which is presented programmatically from a bar button item: - (IBAction)configChartTapped:(id)sender { if (self.popover.isPopoverVisible) { [self.popover dismissPopoverAnimated:YES]; } else { UINavigationController *chartConfigNavigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"GrowthChartNavigationController"]; ConfigChartTypeViewController *configChartTypeViewController = (ConfigChartTypeViewController*) chartConfigNavigationController.topViewController; self.popover = [[UIPopoverController alloc]initWithContentViewController:chartConfigNavigationController]; self.popover.popoverContentSize = CGSizeMake(320, 500); self.popover.delegate = self; [self.popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } } Next to this method I have defined a target to unwind the segue (i.e. dismissing the popover)... - (IBAction)cancelConfig:(UIStoryboardSegue *)segue { // } ... and connected it to a cancel button in the navigation view controllers's navigation bar. Connecting the cancel bar button to the cancelConfig button worked fine in Xcode. However, when running the code, nothing happens when clicking on the Cancel button despite Xcode 4.5 should be supporting dismissing popovers when unwinding segues (according to the release docs). What did I miss? Thank you!

    Read the article

  • Get variables in c# from ajax call

    - by fzshah76
    I've got an Ajax call for log in here is the code: //if MOUSE class is clicked $('.mouse').click(function () { //get the form to submit and return a message //how to call the function var name = $('#name').val(); var pwd2 = $('#pwd2').val(); $.ajax({ type:"POST", url: "http://localhost:51870/code/Login.aspx", data: "{ 'name':'" + $('#name').val() + "', 'pwd':'" + $('#pwd2').val() + "' }", contentType: "application/json; charset=utf-8", dataType: "json", context: document.body, success: function () { //$(this).addClass("done"); $(this).hide(); $('.mouse, .window').hide(); } }); }); the problem is I can't seem to catch name and pwd variables in Login page's preinit event or page load event here is the code in c#: protected void Page_PreInit(object sender, EventArgs e) { //taking javascript argument in preinit event //from here I'll have to build the page for specific lookbook var name = Request.QueryString["name"]; var pwd = Request.QueryString["pwd"]; } protected void Page_Load(object sender, EventArgs e) { var name = Request.QueryString["name"]; var pwd = Request.QueryString["pwd"]; SignIn(name); } I can't seem to get username name and password in c# side, help is appreciated. Here is my final javascript code c# code remains the same: <script type="text/javascript"> $(document).ready(function () { //if MOUSE class is clicked $('.mouse').click(function () { var name = $('#name').val(); var pwd = $('#pwd').val(); $.ajax({ url: "http://localhost:51870/code/Login.aspx?name="+ name +"&pwd="+pwd, context: document.body, success: function () { //$(this).addClass("done"); $(this).hide(); $('.mouse, .window').hide(); } }); }); }); </script> Thanks Zachary

    Read the article

  • Silverlight 3 - How to "refresh" a DataGrid content?

    - by Josimari Martarelli
    I have the following scenery: 1 using System; 2 using System.Windows; 3 using System.Windows.Controls; 4 using System.Windows.Documents; 5 using System.Windows.Ink; 6 using System.Windows.Input; 7 using System.Windows.Media; 8 using System.Windows.Media.Animation; 9 using System.Windows.Shapes; 10 using System.Collections.Generic; 11 12 namespace refresh 13 { 14 public partial class MainPage : UserControl 15 { 16 17 List c = new List(); 18 19 public MainPage() 20 { 21 // Required to initialize variables 22 InitializeComponent(); 23 c.Add(new Customer{ _nome = "Josimari", _idade = "29"}); 24 c.Add(new Customer{_nome = "Wesley", _idade = "26"}); 25 c.Add(new Customer{_nome = "Renato",_idade = "31"}); 26 27 this.dtGrid.ItemsSource = c; 28 } 29 30 private void Button_Click(object sender, System.Windows.RoutedEventArgs e) 31 { 32 c.Add(new Customer{_nome = "Maiara",_idade = "18"}); 33 } 34 35 } 36 37 public class Customer 38 { 39 public string _nome{get; set;} 40 public string _idade{get; set;} 41 } 42 } Where, dtGrid is my DataGrid control... The Question is: How to get the UI Updated after adding one more register to my list. I get to solve it setting the DataGrid's Item Source to "" and then setting to the list of Customer objects again, like that: 1 private void Button_Click(object sender, System.Windows.RoutedEventArgs e) 2 3 { 4 5 c.Add(new Customer{_nome = "Maiara",_idade = "18"}); 6 7 this.dtGrid.ItemsSource=""; 8 9 this.dtGrid.ItemsSource=c; 10 11 } 12 Is there a way to get the UI updated or the datagrid's itemsSource refreshed automatically after updating, altering or deleting an item from the list c ? Thank you, Josimari Martarelli

    Read the article

  • Capture keystrokes (e.g., function keys) while a messagebox is up

    - by FastAl
    We have a large WinForms app, and there is a built-in bug reporting system that can be activated during testing via the F5 Key. I am capturing the F5 key with .Net's PreFilterMessage system. This works fine on the main forms, modal dialog boxes, etc. Unfortunately, the program also displays windows messageboxes when it needs to. When there is a bug with that, e.g., wrong text in the messagebox or it shouldn't be there, the messagefilter isn't executed at all when the messagebox is up! I realize I could fix it by either rewriting my own messagebox routine, or kicking off a separate thread that polls GetAsyncKeyState and calls the error reporter from there. However I was hoping for a method that was less of a hack. Here's code that manifests the problem: Public Class Form1 Implements IMessageFilter Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click MsgBox("now, a messagebox is up!") End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Application.AddMessageFilter(Me) End Sub Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) _ As Boolean Implements IMessageFilter.PreFilterMessage Const VK_F5 As Int32 = &H74 Const WM_KEYDOWN As Integer = &H100 If m.Msg = WM_KEYDOWN And m.WParam.ToInt32 = VK_F5 Then ' In reality code here takes a screenshot, saves the program state, and shows a bug report interface ' IO.File.AppendAllText("c:\bugs.txt", InputBox("Describe the bug:")) End If End Function End Class Many thanks.

    Read the article

  • How to Set focus on the 1st Item of Nested Listbox in Silverlight?

    - by Subhen
    Hi , I have a List box which contains another lisbox Inside it. <ListBox x:Name="listBoxParent"> <ListBox.ItemTemplate> <DataTemplate> <Image x:Name="thumbNailImagePath" Source="/this.jpg" Style="{StaticResource ThumbNailPreview}" /> <TextBlock Margin="5" Text="{Binding Smthing}" Style="{StaticResource TitleBlock_Artist}" /> </StackPanel> <StackPanel Style="{StaticResource someStyle}" > <ListBox x:Name="listBoxChild" Loaded="listBoxChild_Loaded" BorderThickness="0"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Margin="5" Text="{Binding myText}" Width="300"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> <ListBox.ItemsPanel> </ListBox.ItemsPanel> </ListBox> Now while I try to focus to the child List Box : public void listBoxChild_Loaded(object sender, RoutedEventArgs e) { var myListBox = (ListBox)sender; myListBox .ItemsSource = PageVariables.eOUTData;//listboxSongsData; myListBox .SelectedIndex = 0; myListBox .Focus(); } Thanks, Subhen

    Read the article

  • DataGridViewColumn.DataPropertyName Property

    - by Captain Comic
    Hi I have a DataGridView control and I want to populate it with data. I use DataSource property // dgvDealAsset is DataGridView private void DealAssetListControl_Load(object sender, EventArgs e) { dgvDealAssets.AutoGenerateColumns = false; dgvDealAssets.DataSource = DealAssetList.Instance.Values.ToList(); } Now problem number one. The class of my collection does not contain only simple types that I can map to columns using DataPropertyName. This is the class that is contained in collection. class MyClass { public String Name; MyOtherClass otherclass; } class MyOtherClass { public String Name; } Now I am binding properties of MyClass to columns col1.DataPropertyName = "Name" // Ok col2.DataPropertyName = "otherclass" // Not OK - I will have empty cell The problem is that I want to display otherclass.Name field. But if I try to write col2.DataPropertyName = "otherclass.Name" I get empty cell. I tried to manually set the column private void DealAssetListControl_Load(object sender, EventArgs e) { dgvDealAssets.AutoGenerateColumns = false; dgvDealAssets.DataSource = DealAssetList.Instance.Values.ToList(); // iterate through rows and set the column manually foreach (DataGridViewRow row in dgvDealAssets.Rows) { row.Cells["Column2"].Value = ((DealAsset)row.DataBoundItem).otherclass.Name; } But this foreach cycle takes about minute to complete (2k elements). How to solve this problem?

    Read the article

  • ASP.NET Timer Event

    - by K Ratnajyothi
    protected void SubmitButtonClicked(object sender, EventArgs e) { System.Timers.Timer timer = new System.Timers.Timer(); --- --- //line 1 get_datasource(); String message = "submitted."; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "popupAlert", "popupAlert(' " + message + " ');", true); timer.Interval = 30000; timer.Elapsed += new ElapsedEventHandler(timer_tick); // Only raise the event the first time Interval elapses. timer.AutoReset = false; timer.Enabled = true; } } protected void timer_tick(object sender, EventArgs e) { //line 2 get_datasource(); GridView2.DataBind(); } The problem is with the data in the grid view that is being displayed... since when get_datasource which is after line 1 is called the updated data is displayed in the grid view since it is a postback event but when the timer event handler is calling the timer_tick event the get_datasource function is called but after that the updated data is not visible in the grid view. It is nnot getting updated since the timer_tick is not a post back event

    Read the article

  • Drag and drop rectangle in C#

    - by sama
    I want to know how to draw rectangle in C# and make it dragged and dropped in the page here my code to draw it but I cannot drag or drop it. public partial class Form1 : Form { public bool drag = false; int cur_x, cur_y; Rectangle rec = new Rectangle(10, 10, 100, 100); public Form1() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs r) { base.OnPaint(r); Graphics g = r.Graphics; //g.DrawRectangle(Pens.Black, rec); g.FillRectangle(Brushes.Aquamarine, rec); } private void recmousedown(object sender, MouseEventArgs m) { if (m.Button != MouseButtons.Left) return; rec = new Rectangle(m.X, m.Y,100,100); drag = true; cur_x = m.X; cur_y = m.Y; } private void recmousemove(object sender, MouseEventArgs m) { if (m.Button != MouseButtons.Left) return; rec.X = m.X; rec.Y = m.Y; Invalidate(); } }

    Read the article

  • Getting gridview column value as parameter for javascript function

    - by newName
    I have a gridview with certain number of columns and the ID column where I want to get the value from is currently set to visible = false. The other column is a TemplateField column (LinkButton) and as the user clicks on the button it will grab the value from the ID column and pass the value to one of my javascript function. WebForm: <script language=javascript> function openContent(contentID) { window.open('myContentPage.aspx?contentID=' + contentID , 'View Content','left=300,top=300,toolbar=no,scrollbars=yes,width=1000,height=500'); return false; } </script> <asp:GridView ID="gvCourse" runat="server" AutoGenerateColumns="False" OnRowCommand="gvCourse_RowCommand" OnRowDataBound="gvCourse_RowDataBound" BorderStyle="None" GridLines="None"> <RowStyle BorderStyle="None" /> <Columns> <asp:TemplateField> <ItemTemplate> <asp:LinkButton ID="lnkContent" runat="server" CommandName="View" CommandArgument='<%#Eval("contentID") %>' Text='<%#Eval("contentName") %>'> </asp:LinkButton> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="contentID" HeaderText="contentID" ReadOnly="True" SortExpression="contentID" Visible="False" /> <asp:BoundField DataField="ContentName" HeaderText="ContentName" ReadOnly="True" SortExpression="ContentName" Visible="False" /> </Columns> <AlternatingRowStyle BorderStyle="None" /> Code behind: protected void gvCourse_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "View") { intID = Convert.ToInt32(e.CommandArgument); } } protected void gvCourse_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { ((LinkButton)e.Row.FindControl("lnkContent")).Attributes.Add("onclick", "return openContent('" + intID + "');"); } } right not i'm trying to get the intID based on user selected item so when the user clicks on the linkbutton it will open a popup window using javascript and the ID will be used as querystring.

    Read the article

  • UIImagePickerController image editing not working

    - by Greg Reichow
    I am having a problem with implementing UIImagePickerController. When the controller loads, it displays modally, and allows the user to select the image. Good so far. Yet, then when it moves to the editing phase, it often displays somewhat corrupted view (the image cropping box is halfway off the top of the screen) and their is no image. It does not crash, but all UI interaction is blocked. The strange part is that this only happens when I compile with Release settings. Under debug compile settings, the image editing works fine! I have tried checking for memory warnings during this time, but none are showing up. Here is the code calling the image picker controller for reference. When I use the camera (the first method), it always works fine. It is just when selecting images from the Library (called from the second method below) does it fail as described above. And again, only on release build, and with various different types of images. - (IBAction) showCameraController:(id)sender { self.imagePicker =[[UIImagePickerController alloc] init]; self.imagePicker.sourceType=UIImagePickerControllerSourceTypeCamera; self.imagePicker.delegate=self; self.imagePicker.allowsEditing=YES; [self presentModalViewController:self.imagePicker animated:YES]; } - (IBAction) showPictureAlbumController:(id)sender { self.imagePicker =[[UIImagePickerController alloc] init]; self.imagePicker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary; self.imagePicker.delegate=self; self.imagePicker.allowsEditing=YES; [self presentModalViewController:self.imagePicker animated:YES]; } The delegate methods are properly implemented, yet, during the problem I am describing, the controller is not yet calling those methods. It is failing when displaying the editing screen before the user is able to select cancel or save. It is just locking up with no crash. Please help!

    Read the article

  • Problem with dynamic create tabPages in Winforms TabControl

    - by mirt
    I want to create dynamic tabPages in TabControl. In each tabPage I create dataGridView and i want to fill the entire space of each tabPage with this dataGrid. Here is code, where i do this: private void tabControlMutants_SelectedIndexChanged(object sender, EventArgs e) { DataGridView dgw = new DataGridView(); DataGridViewTextBoxColumn testCaseCol = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn resultCol = new System.Windoows.Forms.DataGridViewTextBoxColumn(); // // dataGridView1 // dgw.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dgw.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { testCaseCol, resultCol}); dgw.Location = new System.Drawing.Point(3, 3); dgw.Name = "dataGridView1"; dgw.AutoSize = true; dgw.Dock = System.Windows.Forms.DockStyle.Fill; dgw.TabIndex = 0; // // TestCaseColumn // testCaseCol.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; testCaseCol.HeaderText = "Test Case"; testCaseCol.Name = "TestCaseColumn"; // // ResultColumn // resultCol.HeaderText = "Result"; resultCol.Name = "ResultColumn"; tabControlMutants.TabPages[(sender as TabControl).SelectedIndex].Controls.Add(dgw); ((System.ComponentModel.ISupportInitialize)(dgw)).EndInit(); //fill dataGridView } But it doesn't work, becouse when i resize the main window, data gridView doesn.t change its size (although the dock property is set to fill). Any ideas?

    Read the article

  • PHP SoapClient() function returning a single XML string

    - by gjb
    I am having difficulty with the PHP SoapClient() function. The SOAP request is successful, but the response is returned as an object containing a single XML string with the key "any". For example: <?php $params = array('strUsername' => 'Test', 'strPassword' => 'Test'); $client=new SoapClient('http://www.example.com/webservice.asmx?wsdl', array('features' => SOAP_SINGLE_ELEMENT_ARRAYS)); $result = $client->strExampleCall($params); print_r($result); ?> This outputs the following: stdClass Object ( [strExampleCallResult] => stdClass Object ( [any] => <Response xmlns="" release="1.0.0" environment="Production" lang="en-GB"><ApplicationArea><Sender><SenderId>0</SenderId><ReferenceId>0</ReferenceId></Sender><Destination><DestinationId>1</DestinationId></Destination></ApplicationArea><DataArea><Result>1</Result></DataArea></Response> ) ) Subsequently, I cannot access properties of the object as I'd expect to: echo $result->strExampleCallResult->Response->DataArea->Result; Why isn't PHP parsing the SOAP response into properties of the returned object? I am using PHP 5.3.0 and believe the SOAP server is running .NET. Any suggestions will be much appreciated.

    Read the article

  • [C#]Problem with dynamic create tabPages in TabControl

    - by mirt
    Hello, I want to create dynamic tabPages in TabControl. In each tabPage I create dataGridView and i want to fill the entire space of each tabPage with this dataGrid. Here is code, where i do this: private void tabControlMutants_SelectedIndexChanged(object sender, EventArgs e) { DataGridView dgw = new DataGridView(); DataGridViewTextBoxColumn testCaseCol = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn resultCol = new System.Windoows.Forms.DataGridViewTextBoxColumn(); // // dataGridView1 // dgw.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dgw.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { testCaseCol, resultCol}); dgw.Location = new System.Drawing.Point(3, 3); dgw.Name = "dataGridView1"; dgw.AutoSize = true; dgw.Dock = System.Windows.Forms.DockStyle.Fill; dgw.TabIndex = 0; // // TestCaseColumn // testCaseCol.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; testCaseCol.HeaderText = "Test Case"; testCaseCol.Name = "TestCaseColumn"; // // ResultColumn // resultCol.HeaderText = "Result"; resultCol.Name = "ResultColumn"; tabControlMutants.TabPages[(sender as TabControl).SelectedIndex].Controls.Add(dgw); ((System.ComponentModel.ISupportInitialize)(dgw)).EndInit(); //fill dataGridView } But it doesn't work, becouse when i resize the main window, data gridView doesn.t change its size (although the dock property is set to fill). Any ideas?

    Read the article

  • Please help! request compression

    - by Naor
    Hi, I wrote an IHttpModule that compress my respone using gzip (I return a lot of data) in order to reduce response size. It is working great as long as the web service doesn't throws an exception. In case exception is thrown, the exception gzipped but the Content-encoding header is disappear and the client doesn't know to read the exception. How can I solve this? Why the header is missing? I need to get the exception in the client. Here is the module: public class JsonCompressionModule : IHttpModule { public JsonCompressionModule() { } public void Dispose() { } public void Init(HttpApplication app) { app.BeginRequest += new EventHandler(Compress); } private void Compress(object sender, EventArgs e) { HttpApplication app = (HttpApplication)sender; HttpRequest request = app.Request; HttpResponse response = app.Response; try { //Ajax Web Service request is always starts with application/json if (request.ContentType.ToLower(CultureInfo.InvariantCulture).StartsWith("application/json")) { //User may be using an older version of IE which does not support compression, so skip those if (!((request.Browser.IsBrowser("IE")) && (request.Browser.MajorVersion <= 6))) { string acceptEncoding = request.Headers["Accept-Encoding"]; if (!string.IsNullOrEmpty(acceptEncoding)) { acceptEncoding = acceptEncoding.ToLower(CultureInfo.InvariantCulture); if (acceptEncoding.Contains("gzip")) { response.AddHeader("Content-encoding", "gzip"); response.Filter = new GZipStream(response.Filter, CompressionMode.Compress); } else if (acceptEncoding.Contains("deflate")) { response.AddHeader("Content-encoding", "deflate"); response.Filter = new DeflateStream(response.Filter, CompressionMode.Compress); } } } } } catch (Exception ex) { int i = 4; } } } Here is the web service: [WebMethod] public void DoSomething() { throw new Exception("This message get currupted on the client because the client doesn't know it gzipped."); } I appriciate any help. Thanks!

    Read the article

  • DropDownList SelectedIndex problem in FireFox after page refresh

    - by jartur
    I've got DropDownList in UpdatePanel as shown below: <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:DropDownList ID="DropDownList1" runat="server"> </asp:DropDownList> <div> Index: <asp:Label ID="Label1" runat="server" Text=""></asp:Label> </div> </ContentTemplate> </asp:UpdatePanel> In my codebehind i've got this simple code: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FillDropDownList(); } } private void FillDropDownList() { for (int i = 0; i < 10; i++) { DropDownList1.Items.Add(new ListItem(i.ToString(), i.ToString())); } DropDownList1.SelectedIndex = 0; Label1.Text = DropDownList1.SelectedIndex.ToString(); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { Label1.Text = DropDownList1.SelectedIndex.ToString(); } Here is the problem: I select in the list some item grater than 0 e.g. 5, the label shows value 5. But when I refresh the page, by hitting the refresh button in firefox, the label shows value 0 (as it's supposed to) but the dropdownlist shows 5. I checked the page html source and the dropdown has selected value 0, but shows 5. However, When I refresh the page by putting cursor in address bar and press enter everythig works fine (drowdownlist shows 0). The problem occurs only in FireFox (I've got version 3.5.7). Any ideas what can cause this problem?

    Read the article

  • problem disposing class in Dictionary it is Still in the heap memory although using GC.Collect

    - by Bahgat Mashaly
    Hello i have a problem disposing class in Dictionary this is my code private Dictionary<string, MyProcessor> Processors = new Dictionary<string, MyProcessor>(); private void button1_Click(object sender, EventArgs e) { if (!Processors.ContainsKey(textBox1.Text)) { Processors.Add(textBox1.Text, new MyProcessor()); } } private void button2_Click(object sender, EventArgs e) { MyProcessor currnt_processor = Processors[textBox1.Text]; Processors.Remove(textBox2.Text); currnt_processor.Dispose(); currnt_processor = null; GC.Collect(); } public class MyProcessor: IDisposable { private bool isDisposed = false; string x = ""; public MyProcessor() { for (int i = 0; i < 20000; i++) { //this line only to increase the memory usage to know if the class is dispose or not x = x + "gggggggggggg"; } this.Dispose(); GC.SuppressFinalize(this); } public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } public void Dispose(bool disposing) { if (!this.isDisposed) { isDisposed = true; this.Dispose(); } } ~MyProcessor() { Dispose(false); } } i use "ANTS Memory Profiler" to monitor heap memory the disposing work only when i remove all keys from dictionary how can i destroy the class from heap memory ? thanks in advance

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >