User Profile

Collapse

Profile Sidebar

Collapse
spamguy
spamguy
Last Activity: Dec 17 '09, 10:30 PM
Joined: Sep 26 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • spamguy
    started a topic GridView Update Not Firing

    GridView Update Not Firing

    I am working porting ugly .NET 1.1 DataGrids to 2.0 GridViews. The GridView fills correctly via SqlDataSource. When I click Edit -> [make a field change] -> Update, the page refreshes but the update command clearly never fired. (Putting stuff in the GridView's OnRowUpdating function proves this.) The row also remains in edit mode.

    The code:

    [code=html]<asp:SqlDataSou rce ID="dsMyReports " runat="server"...
    See more | Go to post

  • spamguy
    replied to Detecting IFRAME Container
    This is actually a very good idea. It just requires an extra minute of effort to get working in the CodeIgniter PHP framework. Something like this in the controller:

    [code=php]
    function myTabsPage($ban ner) // '1' as URL parameter automatically put in $banner
    {
    $data['display'] = $banner == 1 ? 'none' : 'block';

    $this -> load -> view('myView', $data);
    }
    [/code]
    ...
    See more | Go to post

    Leave a comment:


  • spamguy
    started a topic Detecting IFRAME Container

    Detecting IFRAME Container

    I have a page that can be accessed either directly or by an AJAX tabs interface (courtesy jQuery). If accessed directly, I want the page's banner to be visible. If indirectly, the banner needs to be not displayed ('display:none' ).

    If AJAX and IFRAMEs weren't involved, a containing object would be a pretty easy thing to detect. Since I'm using jQuery, though, I'm having trouble.

    Any suggestions? Thanks.
    See more | Go to post

  • spamguy
    started a topic Reading A File Via Stream
    in .NET

    Reading A File Via Stream

    One function in this fabulous DLL requests a file read in the form of the Stream class...not StreamWriter or StreamReader or MemoryStream, just Stream. Since Stream is abstract, this makes it hard. I've done my best to bounce from Stream to MemoryStream to whatever else, but it just isn't working out. Here's all I have so far, which isn't much. Can someone fill in the blanks? Thanks!

    [code=cpp]
    public void GetData()
    {...
    See more | Go to post

  • spamguy
    replied to Validation Breaks Postback (C#)
    in .NET
    It's a mixture of RequiredFieldVa lidators and RegularExpressi onValidators. Any fields with errors have red asterisks appear beside them; errors are listed in the ValidationSumma ry up top:

    [code=html]
    <form id="form1" method="POST" action="" runat="server">
    <div style="width:10 0%">
    <asp:Validation Summary ID="ValidationS ummary1"...
    See more | Go to post

    Leave a comment:


  • spamguy
    replied to Validation Breaks Postback (C#)
    in .NET
    Right. Since these controls were working as expected earlier, AutoPostBack was and still is set to true....
    See more | Go to post

    Leave a comment:


  • spamguy
    replied to Validation Breaks Postback (C#)
    in .NET
    I normally supply code with my questions, but as I said, I didn't find anything of worth in Page_Load(), so I left it off. But you're welcome to it. As a bonus is a DropDownList also not responding to postback; it should enable a TextBox when 'Other' is chosen:

    [code=cpp]
    protected void Page_Load(objec t sender, EventArgs e)
    {
    // enable/disable secondary contact fields based on checkbox status
    Panel1.Enabled...
    See more | Go to post

    Leave a comment:


  • spamguy
    started a topic Validation Breaks Postback (C#)
    in .NET

    Validation Breaks Postback (C#)

    Before I added validation features, I had a few controls that made use of postback: for example, click a checkbox to make Panel1 and subcontrols visible.

    I've since added clientside and serverside validation and suddenly postback is broken. Only if 'Submit' is clicked does the form update with changes that should have occured automatically.

    Page_Load() has nothing involving IsPostBack, so I have no idea what else could...
    See more | Go to post

  • spamguy
    replied to C#: Panel Won't (Un)Hide
    in .NET
    I think I figured out the source of the problem.

    When there are validation controls in place, the page blocks a button click event when something isn't filled in right and pulls up a validation dialog using Javascript or somesuch. As long as there's a validation violation, there's no postback and no call of Button_Click() -- anything I put in the codebehind to check data myself won't get used.

    So now the question becomes:...
    See more | Go to post

    Leave a comment:


  • spamguy
    replied to C#: Panel Won't (Un)Hide
    in .NET
    <div> any thinner than 100% width centres differently from <span>. The only way I've found to centre a <div> is to nest them:

    [code=html]
    <div style="width:10 0%">
    <div style="margin-left:auto;margi n-right:auto">Hi there</div>
    </div>
    [/code]...
    See more | Go to post

    Leave a comment:


  • spamguy
    replied to C#: Panel Won't (Un)Hide
    in .NET
    In addition:

    The Label inside the Panel doesn't seem to want to change, either. If I leave the Panel visible and tell the text to change to an arbitrary string on button click, it doesn't. Something's fishy, but I don't know what.
    See more | Go to post

    Leave a comment:


  • spamguy
    started a topic C#: Panel Won't (Un)Hide
    in .NET

    C#: Panel Won't (Un)Hide

    I have a panel that I want to act as an extension of ValidationSumma ry. Some fields are simply too complex for a RegEx to analyse, so I check them on a button click event and pass error messages to a Label contained in the aforementioned Panel.

    Trouble is, the Panel doesn't unhide! A rougher alternative I tried, if (!IsPostBack), doesn't work either.

    [code=html]
    <form id="Form1" method="POST"...
    See more | Go to post
    Last edited by Plater; Feb 27 '08, 06:03 PM. Reason: made code easier to read

  • ddlB is filled through FillBList(), which is more or less FillAList() adjusted for different data:

    [code=cpp]public DataSet FillBList()
    {
    SqlConnection fillConnection = new SqlConnection(c onnection_strin g);

    DataSet listDataSet = new DataSet();

    SqlDataAdapter listAdapter = new SqlDataAdapter( "SELECT ID, Name FROM TableB UNION SELECT -1, '' ORDER BY Name", fillConnection) ;
    ...
    See more | Go to post

    Leave a comment:


  • DataGrid_Update Sees One DropDownList, Ignores Another

    Assume a DataGrid that, during edit mode, has two DropDownMenus, ddlA
    and ddlB. Upon clicking 'Save,' the app performs the simplified task
    of copying the DDL values of each to a label.

    [code=cpp]public void dg_Update(Objec t sender, DataGridCommand EventArgs e)
    {
    // VARIABLES --------------
    DropDownList ddlA = (DropDownList) e.Item.FindCont rol("ddlAEdit") ;
    DropDownList...
    See more | Go to post

  • spamguy
    replied to C#: SelectedIndex Returns -1
    in .NET
    Hmmm, I haven't found the proper way to bind whilst keeping the DDL index intact. Occasional tests return values other than -1, but they're always the old, default values and not the newly selected values.

    This configuration of binds achieves the latter. It's probably missing several binds to achieve 100% functionality (e.g., cancelling is missing one), but I'm just focusing on getting the DDL to respond:

    [code=cpp]private...
    See more | Go to post

    Leave a comment:


  • spamguy
    replied to C#: SelectedIndex Returns -1
    in .NET
    OK, but if I remove data binding from the (!IsPostBack) block, every time I execute an action inside DataGrid (edit, delete, etc.), the data won't be updated. Clicking 'Edit' will produce duplicate rows, and deleted rows will still show up....
    See more | Go to post

    Leave a comment:


  • spamguy
    started a topic C#: SelectedIndex Returns -1
    in .NET

    C#: SelectedIndex Returns -1

    This function fires when the DataGrid roleList is updated by clicking 'Save' on a given row. Successful operation involves finding a DropDownList, getting its SelectedIndex, and printing it on a label:

    [code=cpp]
    public void roleList_Update (Object sender, DataGridCommand EventArgs e)
    {
    // VARIABLES --------------
    DropDownList ddlCompany = (DropDownList) e.Item.FindCont rol("ddlCompany Edit");...
    See more | Go to post

  • spamguy
    started a topic C#: 'There is no row at position 0'
    in .NET

    C#: 'There is no row at position 0'

    I have a DataGrid and am attempting to have in-grid data editing. At the moment I'm working with a single DropDownList:

    [code=cpp]public void roleList_Update (Object sender, DataGridCommand EventArgs e)
    {
    int newRoleID = 666;

    DropDownList ddl = (DropDownList) e.Item.FindCont rol("ddlRoleEdi t");

    if (ddl != null)
    newRoleID = int.Parse(ddl.S electedValue);

    ...
    See more | Go to post

  • Still having no luck. In addition, I used the wrong EventArgs type, even though I swear it worked at one point. The corrected C# code is below. With plain old EventArgs, it's even harder than before to do what I want.

    [code=cpp]public void ddlRoleEdit_Ite mDataBound(Obje ct sender, EventArgs e)
    {
    DropDownList ddl = (DropDownList) sender;
    ddl.SelectedVal ue = ***
    }[/code]
    See more | Go to post

    Leave a comment:


  • (C#) DropDownList Using SelectedIndex w/ onDataBinding

    I have a DataGrid and a column that changes into a DropDownList when edited:

    [code=html]
    <columns>
    <asp:templateco lumn headertext="Rol e Type">
    <itemtemplate >
    <asp:hyperlin k id="hlinkRoleTy pe" navigateurl='<% # "contact_roles_ details.aspx?id =" + DataBinder.Eval (Container, "DataItem.I D", "{0}").ToString () %>' Text='<%# DataBinder.Eval (Container,...
    See more | Go to post
No activity results to display
Show More
Working...