Search Results

Search found 3040 results on 122 pages for 'saving'.

Page 12/122 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • WYSIHAT Installation - not saving photos - Ruby on Rails

    - by bgadoci
    I just successfully installed WysiHat in my rails blog. Seems that the 'add a picture' feature is not working. It successfully allows me to find and select a picture from my desktop but upon clicking save, it does nothing. I also have Paperclip successfully installed. I am wondering if this may have something to do with it. Perhaps Paperclip is getting in the way, or, perhaps I need to connect Paperclip and WysiHat somehow. Any ideas? (let me know if I need to post any code).

    Read the article

  • MyEclipse builds workspace on saving JSP page every time

    - by Tahir Akram
    Whenever I save a jsp page, MyEclipse IDE start building the workspace. It should build when I change in any class file. Or if there are classes that not compiled. But why it start building whole workspace when I change in a JSP file. I am stuck on it. Please advise me on this problem. I am using MyEclipse 5.5 over Eclipse 3.2 Thanks.

    Read the article

  • Saving Interface Builder Changes when building in Xcode

    - by Tony Eichelberger
    I know many of you have experienced the same the scenario, where you are banging your head against the wall wondering what is wrong with your app only to find that you have forgotten to save your Interface Builder changes. Well, this never happens to me, because for some reason Xcode will prompt me to save any changes in Interface Builder whenever I build. A coworker and I are trying to figure out how to change this on his machine, with no success. I must have done something in the very early stages of my iphone development life to configure this. Does anyone know how to link IB with Xcode so that it will prompt to save changes to IB files during a build?

    Read the article

  • Sitecore - Rich Text Editor field is not saving information but instead just copying old information

    - by Younes
    We are using Sitecore.NET 5.3.1 (rev. 071114) and we found out a problem. When we are trying to change information in a Rich Text Editor field on the Master database and save the information, this information is not stored and instead the old information appears back into the RTE field. I have been trying this on the Web database on which this is not happening. However, changing this information on the web database feels useless because a publish will just change every information that does not correspond to the data in the Master database in which i just can't edit this field. So I'm having big trouble at this point since this is for one of our bigger customers and they really want this fixxed asap. We (Estate Internet) already have had an open ticket for this problem, but never got the solution. Hope that someone here knows what the problem may be.

    Read the article

  • Not saving all data in cakephp

    - by madphp
    Hi, Im doing a simple save, and its not entering all the data. I have two models, message and emailmessage. The message table is getting populated ok, but the emailmessage table, is only getting the foreign key message_id. Below is the code. Anyone notice anything unsual? EmailMessageModel - http://pastebin.com/tjNewnBw MessageModel - http://pastebin.com/57FSgAGZ EmailMessageController - http://pastebin.com/AD0wNawx Data - http://pastebin.com/8bzknwpu Thanks --Mark

    Read the article

  • Android: Voice Recording and saving audio

    - by user1320912
    I am working on application that will record the voice of the user and save the file on the SD card and then allow the user to listen to the audio again. I am able to allow the user to record his voice using the RecognizerIntent, but I cant figure out how to save the audio file and allow the user to hear the audio. I would appreciate it if someone could help me out. I have displayed my code below: // Setting up the onClickListener for Audio Button attachVoice = (Button) findViewById(R.id.AttachVoice_questionandanswer); attachVoice.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); voiceIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); voiceIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Please Speak"); startActivityForResult(voiceIntent, VOICE_REQUEST); } }); protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(requestCode == VOICE_REQUEST && resultCode == RESULT_OK){ }

    Read the article

  • Make user download pdf instead of saving to a location

    - by chupinette
    Hello!I was trying out the following code which actually saves the pdf file to C:/xampp/ I want to create a link so that when the user clicks on it. It prompts it to save the pdf file. <?php // create handle for new PDF document $pdf = pdf_new(); // open a file pdf_open_file($pdf, "try1.pdf"); // start a new page (A4) pdf_begin_page($pdf, 595, 842); pdf_set_parameter($pdf, 'FontOutline', 'Arial=c:\windows\fonts\arial.ttf'); // get and use a font object $font = pdf_findfont($pdf, "Arial", "host", 1); pdf_setfont($pdf, $font, 10); // print text pdf_show_xy($pdf, "There are more things in heaven and earth, Horatio,", 50, 750); pdf_show_xy($pdf, "than are dreamt of in your philosophy", 50, 730); // add an image under the text //$image = pdf_open_image_file($pdf, "jpeg", "shakespeare.jpg"); pdf_place_image($pdf, $image, 50, 650, 0.25); // end page pdf_end_page($pdf); // close and save file pdf_close($pdf); ?>

    Read the article

  • AS3 microphone recording/saving works, in-flash PCM playback double speed

    - by Lowgain
    I have a working mic recording script in AS3 which I have been able to successfully use to save .wav files to a server through AMF. These files playback fine in any audio player with no weird effects. For reference, here is what I am doing to capture the mic's ByteArray: (within a class called AudioRecorder) public function startRecording():void { _rawData = new ByteArray(); _microphone.addEventListener(SampleDataEvent.SAMPLE_DATA, _samplesCaptured, false, 0, true); } private function _samplesCaptured(e:SampleDataEvent):void { _rawData.writeBytes(e.data); } This works with no problems. After the recording is complete I can take the _rawData variable and run it through a WavWriter class, etc. However, if I run this same ByteArray as a sound using the following code which I adapted from the adobe cookbook: (within a class called WavPlayer) public function playSound(data:ByteArray):void { _wavData = data; _wavData.position = 0; _sound.addEventListener(SampleDataEvent.SAMPLE_DATA, _playSoundHandler); _channel = _sound.play(); _channel.addEventListener(Event.SOUND_COMPLETE, _onPlaybackComplete, false, 0, true); } private function _playSoundHandler(e:SampleDataEvent):void { if(_wavData.bytesAvailable <= 0) return; for(var i:int = 0; i < 8192; i++) { var sample:Number = 0; if(_wavData.bytesAvailable > 0) sample = _wavData.readFloat(); e.data.writeFloat(sample); } } The audio file plays at double speed! I checked recording bitrates and such and am pretty sure those are all correct, and I tried changing the buffer size and whatever other numbers I could think of. Could it be a mono vs stereo thing? Hope I was clear enough here, thanks!

    Read the article

  • how to read a User uploaded file, without saving it to the database

    - by GoodGets
    I'd like to be able to read an XML file uploaded by the user (less than 100kb), but not have to first save that file to the database. I don't need that file past the current action (its contents get parsed and added to the database; however, parsing the file is not the problem). Since local files can be read with: File.read("export.opml") I thought about just creating a file_field for :uploaded_file, then trying to read it with File.read(params[:uploaded_file]) but all that does is throw a TypeError (can't convert HashWithIndifferentAccess into String). I really have tried a lot of various things (including reading from the /tmp directory as well), but could get none of them to work. I hope the brevity of my question doesn't mask the effort I've given to try to solve this on my own, but I didn't want to pollute this question with a hundred ways of how NOT to get it done. Big thanks to anyone who chimes in.

    Read the article

  • VB.net Saving an MetaFile / EMF as a bitmap ( .tiff)

    - by pehaada
    Currently I have a third party control that generates a Metafile. I can save the .wmf file to disk with out issue. The problem is how do I render the Metafile as a Tiff file. Currently I have the following code to get my metafile and save it. Dim mf As Metafile = page.GetImage(TXTextControl.Page.PageContent.All) Dim enhMetafileHandle As IntPtr = mf.GetHenhmetafile() Dim h As IntPtr Dim bufferSize As UInteger = GetEnhMetaFileBits(enhMetafileHandle, 0, h) Dim buffer(CInt(bufferSize)) As Byte GetEnhMetaFileBits(enhMetafileHandle, bufferSize, buffer) Dim msMetafileStream As New MemoryStream msMetafileStream.Write(buffer, 0, CInt(bufferSize)) Dim baMetafileData() As Byte baMetafileData = msMetafileStream.ToArray Dim g As Graphics = Graphics.FromImage(mf) mf.Dispose() File.WriteAllBytes("c:\a.wmf", baMetafileData) end sub _ Public Shared Function GetEnhMetaFileBits( ByVal hEMF As System.IntPtr, ByVal nSize As UInteger, ByVal lpData As IntPtr) As UInteger End Function <System.Runtime.InteropServices.DllImportAttribute("gdi32.dll", EntryPoint:="GetEnhMetaFileBits")> _ Public Shared Function GetEnhMetaFileBits(<System.Runtime.InteropServices.InAttribute()> ByVal hEMF As System.IntPtr, ByVal nSize As UInteger, ByVal lpData() As Byte) As UInteger End Function I've tried all sort of IMAGE and Graphic calls and just can't save the meta file as a .tiff. Any suggestions would be great. I even tried to create a new bitmap and draw the metafile onto it. I always end up with a GDI exception being thrown.

    Read the article

  • iphone image saving

    - by kpower
    I can save image to iPhone (iPhone Photo Albums \ Saved Photos) with UIImageWriteToSavedPhotosAlbum(image, onCompleteTarget, onCompleteSelector, contextInfoToCompleteSelector); But if there any way to check, if current image was already saved (to save it only once)?

    Read the article

  • Django FileField not saving to upload_to location

    - by Erik
    I have an Attachment model that has a FileField in a Django 1.4.1 app. This FileField has a callable upload_to parameter which, per the Django docs should be called when the form (and therefore the model) is saved. When I run FormTest below, the upload_to callable is never called and the file therefore does not appear in the location provided by the upload_to method. What am I doing wrong? Notice that in the passing tests in ModelTest (also below), the upload_to method works as expected. Test: from core.forms.attachments import AttachmentForm from django.test import TestCase import unittest from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.storage import default_storage def suite(): return unittest.TestSuite( [ unittest.TestLoader().loadTestsFromTestCase(FormTest), ] ) class FormTest(TestCase): def test_form_1(self): filename = 'filename' f = file(filename) data = {'name':'name',} file_data = {'attachment_file':SimpleUploadedFile(f.name,f.read()),} form = AttachmentForm(data=data,files=file_data) self.assertTrue(form.is_valid()) attachment = form.save() root_directory = 'attachments' upload_location = root_directory + '/' + attachment.directory + '/' + filename self.assertTrue(attachment.attachment_file) # Fails self.assertTrue(default_storage.exists(upload_location)) # Fails Attachment Model: from django.db import models from parent_mixins import Parent_Mixin import uuid from django.db.models.signals import pre_delete,pre_save from dirtyfields import DirtyFieldsMixin def upload_to(instance,filename): return 'attachments/' + instance.directory + '/' + filename def uuid_directory_name(): return uuid.uuid4().hex class Attachment(DirtyFieldsMixin,Parent_Mixin,models.Model): attachment_file = models.FileField(blank=True,null=True,upload_to=upload_to) directory = models.CharField(blank=False,default=uuid_directory_name,null=False,max_length=32) name = models.CharField(blank=False,default=None,null=False,max_length=128) class Meta: app_label = 'core' def __str__(self): return unicode(self).encode('utf-8') def __unicode__(self): return unicode(self.name) @models.permalink def get_absolute_url(self): return('core_attachments_update',(),{'pk': self.pk}) # def save(self,*args,**kwargs): # super(Attachment,self).save(*args,**kwargs) def pre_delete_callback(sender, instance, *args, **kwargs): if not isinstance(instance, Attachment): return if not instance.attachment_file: return instance.attachment_file.delete(save=False) def pre_save_callback(sender, instance, *args, **kwargs): if not isinstance(instance, Attachment): return if not instance.attachment_file: return if instance.is_dirty(): dirty_fields = instance.get_dirty_fields() if 'attachment_file' in dirty_fields: old_attachment_file = dirty_fields['attachment_file'] old_attachment_file.delete() pre_delete.connect(pre_delete_callback) pre_save.connect(pre_save_callback) Attachment Form: from ..models.attachments import Attachment from crispy_forms.helper import FormHelper from crispy_forms.layout import Div,Layout,HTML,Field,Fieldset,Button,ButtonHolder,Submit from django import forms class AttachmentFormHelper(FormHelper): form_tag=False layout = Layout( Div( Div( Field('name',css_class='span4'), Field('attachment_file',css_class='span4'), css_class='span4', ), css_class='row', ), ) class AttachmentForm(forms.ModelForm): helper = AttachmentFormHelper() class Meta: fields=('attachment_file','name') model = Attachment class AttachmentInlineFormHelper(FormHelper): form_tag=False form_style='inline' layout = Layout( Div( Div( Field('name',css_class='span4'), Field('attachment_file',css_class='span4'), Field('DELETE',css_class='span4'), css_class='span4', ), css_class='row', ), ) class AttachmentInlineForm(forms.ModelForm): helper = AttachmentInlineFormHelper() class Meta: fields=('attachment_file','name') model = Attachment UPDATE I also do testing on the Attachment model class with these unit tests -- which all pass: from core.models.attachments import Attachment from core.models.attachments import upload_to from django.test import TestCase import unittest from django.core.files.storage import default_storage from django.core.files.base import ContentFile def suite(): return unittest.TestSuite( [ unittest.TestLoader().loadTestsFromTestCase(ModelTest), ] ) class ModelTest(TestCase): def test_model_minimum_fields(self): attachment = Attachment(name='name') attachment.attachment_file.save('test.txt',ContentFile("hello world")) attachment.save() self.assertEqual(str(attachment),'name') self.assertEqual(unicode(attachment),'name') self.assertTrue(attachment.directory) # def test_model_full_fields(self): # attachment = Attachment() # attachement.save() def test_file_operations_basic(self): root_directory = 'attachments' filename = 'test.txt' attachment = Attachment(name='name') attachment.attachment_file.save(filename,ContentFile('test')) attachment.save() upload_location = root_directory + '/' + attachment.directory + '/' + filename self.assertEqual(upload_to(attachment,filename),upload_location) self.assertTrue(default_storage.exists(upload_location)) def test_file_operations_delete(self): root_directory = 'attachments' filename = 'test.txt' attachment = Attachment(name='name') attachment.attachment_file.save(filename,ContentFile('test')) attachment.save() upload_location = upload_to(attachment,filename) attachment.delete() self.assertFalse(default_storage.exists(upload_location)) def test_file_operations_change(self): root_directory = 'attachments' filename_1 = 'test_1.txt' attachment = Attachment(name='name') attachment.attachment_file.save(filename_1,ContentFile('test')) attachment.save() upload_location_1 = upload_to(attachment,filename_1) self.assertTrue(default_storage.exists(upload_location_1)) filename_2 = 'test_2.txt' attachment.attachment_file.save(filename_2,ContentFile('test')) attachment.save() upload_location_2 = upload_to(attachment,filename_2) self.assertTrue(default_storage.exists(upload_location_2)) self.assertFalse(default_storage.exists(upload_location_1))

    Read the article

  • Saving integers as Strings in MIPS

    - by Krewie
    Hello , i was just wondering, is there any way in MIPS to store a summation of numbers as a string and later read them byte by byte, for example: the sum 657 - sw into a .ascii directive - later lb on the first index to get 6 (in ascii code) same with 5 and so on Is this possible ? //Thx in advance

    Read the article

  • iOS Efficiency File Saving Efficiency

    - by Guvvy Aba
    I was working on my iOS app and my goal is to save a file that I am receiving from the internet bit by bit. My current setup is that I have a NSMutableData object and I add a bit of data to it as I receive my file. After the last "packet" is received, I write the NSData to a file and the process is complete. I'm kind of worried that this isn't the ideal way to do it because of the limitations of RAM in a mobile device and it would be problematic to receive large files. My next thought was to implement a NSFileHandle so that as the file arrives, it would be saved to the disk, rather than the virtual memory. In terms of speed and efficiency, which method do you think will work decently on an iOS device. I am currently using the first, NSMutableData approach. Is it worth changing my app to use the NSFileHandle? Thanks in advance, Guvvy

    Read the article

  • Saving webpage content using webbrowser IHTMLDocument interface

    - by Ramanand Bhat
    Hi, We need to save the complete web page including img, javascript, css and html using ATL webbrowser (IHTMLDocument) control, using IHTMLDocument2::get_all() method we have saved .html file but now how do we get external files such as .css, javascript and image files please help us with methods that internet explorer or firefox used to save the web page locally. Thanks, Ramanand.

    Read the article

  • NSUserDefaults not saving properly

    - by BWC
    Hey Guys I'm having issues with NSUserDefaults and I don't quite understand what's going on My App has 5 levels and each level does the exact same thing with NSUserDefaults (Retrieves the levels defaults, changes the value as the user plays the level and then sets the defaults and syncronizes at the end of the level) the first 4 levels...work without a hitch but the last level doesn't save the values. The app doesn't crash and the last level isn't the very last thing that happens, And I even have the defaults synchronized when the application terminates. Is there a max size on the NSUserDefaults or is there anything anyone can think of that I haven't, I'll post the code below but like I said the first four levels work perfectly //header NSUserDefaults *userData; @property(nonatomic,retain) NSUserDefaults *userData; //class file //Sets the boolean variables for the class to use userData = [NSUserDefaults standardUserDefaults]; boolOne = [userData boolForKey:@"LevelFiveBoolOne"]; boolTwo = [userData boolForKey:@"LevelFiveBoolTwo"]; boolThree = [userData boolForKey:@"LevelFiveBoolThree"]; boolFour = [userData boolForKey:@"LevelFiveBoolFour"]; boolFive = [userData boolForKey:@"LevelFiveBoolFive"]; boolSix = [userData boolForKey:@"LevelFiveBoolSix"]; boolSeven = [userData boolForKey:@"LevelFiveBoolSeven"]; //End Of Level [userData setBool:boolOne forKey:@"LevelFiveBoolOne"]; [userData setBool:boolTwo forKey:@"LevelFiveBoolTwo"]; [userData setBool:boolThree forKey:@"LevelFiveBoolThree"]; [userData setBool:boolFour forKey:@"LevelFiveBoolFour"]; [userData setBool:boolFive forKey:@"LevelFiveBoolFive"]; [userData setBool:boolSix forKey:@"LevelFiveBoolSix"]; [userData setBool:boolSeven forKey:@"LevelFiveBoolSeven"]; [userData synchronize]; When when I switch to the view that uses these defaults they values are correct but when I terminate the application and restart it, these values aren't saved, every other level does the exact same process this is the only level that doesn't work. I've stared at this for quite awhile and I'm hoping someone out there has run into the same problem and can give me some insight on how they resolved it. Thank you in Advance BWC

    Read the article

  • Should the entity framework + self tracking entities be saving me time

    - by sipwiz
    I've been using the entity framework in combination with the self tracking entity code generation templates for my latest silverlight to WCF application. It's the first time I've used the entity framework in a real project and my hope was that I would save myself a lot of time and effort by being able to automatically update the whole data access layer of my project when my database schema changed. Happily I've found that to be the case, updating my database schema by adding a new table, changing column names, adding new columns etc. etc. can be propagated to my business object classes by using the update from database option on the entity framework model. Where I'm hurting is the CRUD operations within my WCF service in response to actions on my Silverlight client. I use the same self tracking entity framework business objects in my Silverlight app but I find I'm continually having to fight against problems such as foreign key associations not being handled correctly when updating an object or the change tracker getting confused about the state of an object at the Silverlight end and the data access operation within the WCF layer throwing a wobbly. It's got to a point where I have now spent more time dealing with this quirks than I have on my previous project where I used Linq-to-SQL as the starting point for rolling my own business objects. Is it just me being hopeless or is the self tracking entities approach something that should be avoided until it's more mature?

    Read the article

  • user creating/saving

    - by Xaver
    i want to write 2 program: 1) programm saves all local users to the file. 2) loads file find that users not found on local machine and create user. for searching all users which create on local machine i use next code: foreach (ManagementObject user in userSearcher.Get()) { if ((bool)user["LocalAccount"]) { string UserName = (string)user["FullName"]; } } How can i save the settings of user by name and create user?

    Read the article

  • JQuery - Ajax saving sortables in connected lists when sortable item is moved

    - by Ben Sinclair
    I have multiple JQuery sortable lists that connect with each other... They allow you to assign users to certain roles. Basically what I want to do is when a user is dragged from one list to another, I want JQuery to pick up the first list that the user was moved from so that I can send an AJAX request to delete it from that list in my database. I tried the following but every time you move the user over a list and haven't even dropped it within a list, it sends this request which means I'll be sending multiple AJAX requests... Does that make sense? $( ".selector" ).sortable({ out: function(event, ui) { ... } }); From my testing, I can use the following code to just update the list that user has been moved to so I've got the second half covered: $( ".selector" ).sortable({ receive: function(event, ui) { ... } }); Hopefully I am making sense :)

    Read the article

  • Time Saving Minutiae

    - by Dave Jarvis
    What little tricks do you use to save time when developing? For example: In JDeveloper, change the default editor to Source view from Design view for JSP files.   Tools » Preferences » File Types » Default Editors » JSP Tag File By default, JDeveloper opens JSP files in Design view, which can take 10 to 15 seconds to begin editing a file. Opening files in Source view only takes 2 seconds.

    Read the article

  • iphone Core Data Unresolved error while saving

    - by Ahmed Kotb
    I am getting a strange error message from the core data when trying to save but the problem that the error is not reproducible ( it appears at different times when doing different tasks) the error message: Unresolved error Domain=NSCocoaErrorDomain Code=1560 UserInfo=0x14f5480 "Operation could not be completed. (Cocoa error 1560.)", { NSDetailedErrors = ( Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x5406d70 "Operation could not be completed. (Cocoa error 1570.)", Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x14f9be0 "Operation could not be completed. (Cocoa error 1570.)" ); } and the method that generates the error is: - (IBAction)saveAction:(id)sender { NSError *error; if (![[self managedObjectContext] save:&error]) { // Handle error NSLog(@"Unresolved error %@, %@, %@", error, [error userInfo],[error localizedDescription]); exit(-1); // Fail } } any idea for the reason of this message ? giving that it appears at random times

    Read the article

  • Why am I getting null object reference error when saving (OnItemUpdating event) the first edit item

    - by craigmoliver
    I'm getting the error "Object reference not set to an instance of an object." when trying to reference a HiddenField (lvEditProjectSteps_hdnStepStatusId for future reference) from the EditItem during the OnItemUpdating event after the Update event fires in a ListView. This only occurs on the FIRST item in the ListView. I checked the source and the HTML is being rendered properly. ANY insight is appreciated! Thanks in advance... Source error: var lvEditProjectSteps_hdnStepStatusId = (HiddenField) lvEditProjectSteps.EditItem.FindControl("lvEditProjectSteps_hdnStepStatusId"); Here's the aspx side of the ListView: <asp:ListView ID="lvEditProjectSteps" runat="server" OnItemDataBound="lvEditProjectSteps_OnItemDataBound" OnItemUpdating="lvEditProjectSteps_OnItemUpdating" DataSourceID="odsEditProjectStep" DataKeyNames="Id"> <LayoutTemplate> <table class="standard-box-style" style="width:800px"> <thead> <tr> <th>&nbsp;</th> <th>&nbsp;</th> <th>Created</th> <th>Updated</th> </tr> </thead> <tbody> <asp:PlaceHolder ID="itemPlaceHolder" runat="server" /> </tbody> </table> </LayoutTemplate> <ItemTemplate> <tr> <td style="width:50px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>> <asp:ImageButton ID="lvEditProjectSteps_btnEdit" runat="server" ImageUrl="~/admin/images/icons/edit.gif" AlternateText="Edit" SkinID="interfaceButton" CommandName="Edit" /> <asp:HiddenField ID="lvEditProjectSteps_hdnId" runat="server" Value='<%# Bind("Id")%>' /> <asp:HiddenField ID="lvEditProjectSteps_hdnStepStatusId" runat="server" Value='<%# Bind("StepStatusId")%>' /> <asp:HiddenField ID="lvEditProjectSteps_hdnStepStatusStepId" runat="server" Value='<%# Bind("StepStatus_StepId")%>' /> </td> <td style="width:30px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>><asp:Image ID="imgStatus" runat="server" /></td> <td style="width:75px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>><asp:Literal ID="litTsCreated" runat="server" /></td> <td style="width:75px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>><asp:Literal ID="litTsUpdated" runat="server" /></td> </tr> </ItemTemplate> <EditItemTemplate> <tr> <td style="width:50px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>> <asp:ImageButton ID="lvEditProjectSteps_btnUpdate" runat="server" ImageUrl="~/admin/images/icons/save.png" AlternateText="Save" SkinID="interfaceButton" CommandName="Update" ValidationGroup="EditProjectStepsSave" /> <asp:ImageButton ID="lvEditProjectSteps_btnCancel" runat="server" ImageUrl="~/admin/images/icons/cancel.png" AlternateText="Cancel" SkinID="interfaceButton" CommandName="Cancel" /> <asp:HiddenField ID="lvEditProjectSteps_hdnId" runat="server" Value='<%# Bind("Id")%>' /> <asp:HiddenField ID="lvEditProjectSteps_hdnStepStatusId" runat="server" Value='<%# Bind("StepStatusId")%>' /> <asp:HiddenField ID="lvEditProjectSteps_hdnStepStatusStepId" runat="server" Value='<%# Bind("StepStatus_StepId")%>' /> </td> <td style="width:180px" colspan="3"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>> <div><strong>Status</strong></div> <div class="radiobuttonlist-status"> <asp:RadioButtonList ID="lvEditProjectSteps_rblStatus" runat="server" RepeatDirection="Horizontal" AutoPostBack="true" OnSelectedIndexChanged="lvEditProjectSteps_rblStatus_OnSelectedIndexChanged"> <asp:ListItem Value="1"><img src="/images/icon/project-status/1.png" alt="Error" /></asp:ListItem> <asp:ListItem Value="2"><img src="/images/icon/project-status/2.png" alt="In Progress" /></asp:ListItem> <asp:ListItem Value="3"><img src="/images/icon/project-status/3.png" alt="Complete" /></asp:ListItem> </asp:RadioButtonList> <asp:RequiredFieldValidator ID="valRequired_lvEditProjectSteps_rblStatus" runat="server" ControlToValidate="lvEditProjectSteps_rblStatus" SetFocusOnError="true" Display="Dynamic" ErrorMessage="<br />^ required ^" ValidationGroup="EditProjectStepsSave" /> </div> </td> </tr> </EditItemTemplate> </asp:ListView> And the code-behind: protected void lvEditProjectSteps_OnItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { var info = (ProjectStepInfo)DataBinder.GetDataItem(e.Item); // View Item var litTsCreated = (Literal)e.Item.FindControl("litTsCreated"); var litTsUpdated = (Literal)e.Item.FindControl("litTsUpdated"); var imgStatus = (Image) e.Item.FindControl("imgStatus"); if (litTsCreated != null) litTsCreated.Text = String.Format("{0:d}", info.TsCreated); if (litTsUpdated != null) litTsUpdated.Text = String.Format("{0:d}", info.TsCreated); if (imgStatus != null) imgStatus.ImageUrl = String.Format("/images/icon/project-status/{0}.png", info.StepStatus_StatusId); // Edit Item var lvEditProjectSteps_rblStatus = (RadioButtonList) e.Item.FindControl("lvEditProjectSteps_rblStatus"); if (lvEditProjectSteps_rblStatus != null) lvEditProjectSteps_rblStatus.SelectedValue = info.StepStatus_StatusId.ToString(); } } protected void lvEditProjectSteps_OnItemUpdating(object sender, ListViewUpdateEventArgs e) { if (IsValid) { var oController = new Controller(); var lvEditProjectSteps_hdnStepStatusId = (HiddenField) lvEditProjectSteps.EditItem.FindControl("lvEditProjectSteps_hdnStepStatusId"); var lvEditProjectSteps_hdnStepStatusStepId = (HiddenField) lvEditProjectSteps.EditItem.FindControl("lvEditProjectSteps_hdnStepStatusStepId"); var lvEditProjectSteps_rblStatus = (RadioButtonList) lvEditProjectSteps.EditItem.FindControl("lvEditProjectSteps_rblStatus"); var infoStepStatus = oController.StepStatus_SelectOne_StepId_StatusId(Convert.ToInt32(lvEditProjectSteps_hdnStepStatusStepId.Value), Convert.ToInt32(lvEditProjectSteps_rblStatus.SelectedValue)); if (lvEditProjectSteps_hdnStepStatusId != null) { e.NewValues["ProjectId"] = Convert.ToInt32(lvEditProjectSteps_hdnProjectId.Value); e.NewValues["StepStatusId"] = infoStepStatus.Id; } else { Response.Write("cancel"); e.Cancel = true; } } else { Response.Write("cancel, not valid"); e.Cancel = true; } } protected void lvEditProjectSteps_rblStatus_OnSelectedIndexChanged(object sender, EventArgs e) { var oController = new Controller(); var rbl = (RadioButtonList)sender; var lvEditProjectSteps_txtText = (TextBox) rbl.NamingContainer.FindControl("lvEditProjectSteps_txtText"); var lvEditProjectSteps_txtComment = (TextBox)rbl.NamingContainer.FindControl("lvEditProjectSteps_txtComment"); var lvEditProjectSteps_hdnStepStatusStepId = (HiddenField) rbl.NamingContainer.FindControl("lvEditProjectSteps_hdnStepStatusStepId"); if (!String.IsNullOrEmpty(lvEditProjectSteps_hdnStepStatusStepId.Value) && lvEditProjectSteps_txtText != null && lvEditProjectSteps_txtComment != null) { var infoStep = oController.Step_SelectOne(Convert.ToInt32(lvEditProjectSteps_hdnStepStatusStepId.Value)); var infoStepStatus = oController.StepStatus_SelectOne_StepId_StatusId(Convert.ToInt32(lvEditProjectSteps_hdnStepStatusStepId.Value), Convert.ToInt32(rbl.SelectedValue)); lvEditProjectSteps_txtText.Text = infoStep.Name; lvEditProjectSteps_txtComment.Text = infoStepStatus.Text; } }

    Read the article

  • Problem with saving new elements in my xml at right level

    - by Fore
    I have a xml file that looks like this: <DataTalk> <Posts> <TalkPost> <PostType>dialog</PostType> <User>ABBE</User> <Customer>HRM - Heroma</Customer> <PostedDate>0001-01-01T00:00:00</PostedDate> <Message>TEST</Message> </TalkPost> </Posts> </DataTalk> When I now want to save new elements, I do: document.root.add((new XElement("TalkPost", new XElement("PostType", newDialog.PostType), new XElement("User", newDialog.User), new XElement("Customer", newDialog.Customer), new XElement("PostedDate", newDialog.PostDate), new XElement("Message", newDialog.Message))); The problem is now that it gets saved at the wrong hierarchal level. They all gets saved under <datatalk> and not under <posts> that I wan't to. How should I do to save the new elements under the <posts> hierarchically

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >