Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9311313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:19:57+00:00 2026-06-19T01:19:57+00:00

I am trying to implement an short bio form where each user could edit

  • 0

I am trying to implement an short bio form where each user could edit and update its bio. Based on the fact that if the user has filled the form before or not, the previous text or nothing, gets returned as an initial text in the Textarea.

Here is the block I have for taking the username from the keyboard, searching the dbase for a value and trying to output it on the textarea before the form gets submitted by the user.

A kind of profile memory if you like.

@{
Validation.RequireField("currentuser");
Validation.Add("bioprint", Validator.StringLength(3000, 0, "Your bio should not exceed 3000 characters"));

var init = "";
var currentuser = Request["currentuser"];
var db = Database.Open("ResearchA");
var cbio = db.QuerySingle("SELECT bios FROM usernamesb WHERE username = @0",currentuser); //get current bio string

if (cbio == null) {init = cbio;}        //check if string is NULL
else {init = "Tell us about you...";}

if(IsPost && Validation.IsValid())  {

    var userbio = @Request["Bio"];

    var insertbio = "UPDATE usernamesb SET bios = @0 WHERE username = @1";
    db.Execute(insertbio, userbio, currentuser);  //Update database with a new entry.

 }

}

And here is how I have my controls setup in the HTML block:

<input type="text" name="currentuser" id="currentuser" value="@Request.Form["currentuser"]"/>

<textarea name="Bio" rows="10" cols="50" placeholder ="@cbio"></textarea> 

However I dont get the already existing string output.

Thanks a lot for the interest guys!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:19:58+00:00Added an answer on June 19, 2026 at 1:19 am

    Your cbio variable is currently being loaded with a single row from the database. You need to get one of the fields from that row. Two ways of doing that, either change your database query to be:

    var cbio = db.QueryValue("SELECT bios FROM usernamesb ...
    

    which will return just the string. Or leave your database query the same, and change your way of accessing the field from the row by changing the html part:

    <textarea name="Bio" rows="10" cols="50">@cbio.bios</textarea>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing short-term contract work for a company that is trying to implement
I'm trying to implement a app that provides user position. I tried lots of
I am trying to implement an inner class that has a generic parameterized type.
I am trying to implement a short converter using TinyXML that will take an
I'm trying to implement a view that has both a longClickListener and a gesture
Trying to implement LoaderManager + CursorLoader. In onFinish method adapter should swap its cursor
Trying to implement a search similar to here .This searches properties based on city,locality,property
I'm trying to implement three level scheduling with using threads. In short, I want
I'm trying to implement scrolling functionality in a textBox, so that I'm only displaying
I'm trying to implement a game loop that limits the velocity of execution of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.