Separate Taste löst "Bitte füllen Sie dieses Feld aus" aus.C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Separate Taste löst "Bitte füllen Sie dieses Feld aus" aus.

Post by Anonymous »

Ich erstelle eine Web -App mit C# und ASP.NET. Auf der Webseite gibt es einen Kopfball mit einer Suchleiste und einem Körper mit einer Form. Wenn ich etwas in die Suchleiste eingehe, zeigt eines der Formularfelder das Popup "Bitte füllen Sie dieses Feld aus". Ich sage also, dass mein Suchknopf und mein Formular verbunden sind, aber sie sollten es nicht sein.

Code: Select all

    protected void btnOpenModalSearch(object sender, EventArgs e) {
//get information from database to populate the modal box with

PopulateModalBoxGridView();

ScriptManager.RegisterStartupScript(this, this.GetType(), "Properties",
\ "openModal();", true);
}

protected void PopulateModalBoxGridView() {
if (dtSearch == null) return;

//sort the search results in data table
DataView dvSearch = dtSearch.DefaultView;
dvSearch.Sort = SortOrder;
gridSearchResults.DataSource = dvSearch;
gridSearchResults.DataBind();
}
< /code>

Code hinter dem separaten Formular hinterher: < /p>

protected async void btnCreateNewAsset_Clicked(object objSender, EventArgs evntArgs) {
//create a new asset
//first check for duplicates
if (IsDuplicateAsset()) { return; }

Asset newAsset = new Asset {
//creating asset
};

//post the asset to Team Dynamix
var addAssetUri = new Uri(locationOrigin + webApiBasePath + addAssetPath);
responseMsg = await httpClient.PostAsJsonAsync(addAssetUri, newAsset);
httpResponse = responseMsg.Content.ReadAsStringAsync().Result;

if (!responseMsg.IsSuccessStatusCode) {
Notification.Show(this, "Error.  Response content=" + httpResponse, Status.Error);
}
else {
Notification.Show(this, "Successfully Created Asset.", Status.Success);
assetDictionary.Add(serialNumber.Text, serialNumber.Text);
ClearTextFields(frmIndex);
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post