|
You are right, I have two action AllProducts() and [HttpPost]AllProducts(int zip)
What I am trying to do here is I am passing the zip parameter from json
[HttpPost]
public ActionResult AllProducts(int zip)
{
TempData["zipcode"] = zip;
TempData.Keep("zipcode");
return RedirectToAction("AllProducts");
}
and trying to display zip code in AllProduct view by passing it to AllProducts()
blic ActionResult AllProducts()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
if (TempData["zipcode"] == null)
{
return View();
}
else
{
var code = TempData["zipcode"];
ViewBag.codezip = code;
return View();
}
}
I am newbie to MVC and not sure why is displaying ViewBag.Message and not ViewBag.codezip
What is that I am doing wrong. Please help me out.
|
|
|
|
|
Try simplifying your GET method:
public ActionResult AllProducts()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
ViewBag.codezip = TempData["zipcode"];
return View();
}
Also make sure that you match the case when you reference the value from your view:
Zip code: @ViewBag.codezip
You shouldn't need the TempData.Keep call in your POST action, since you don't read the value until the next request.
If it still doesn't work, then there must be something else going on that we can't see.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i consult these two web site just to know how to work with soap header
https://www.codeproject.com/articles/4398/authentication-for-web-services-using-soap-headers
https://www.codeproject.com/Articles/27365/Authenticate-NET-Web-Service-with-Custom-SOAP-Head
i also develop my web service this way. see the code
namespace CustomAuthWithHTTPModule
{
public class Authentication : SoapHeader
{
public string User;
public string Password;
}
public class SecureWebService : WebService
{
public Authentication authentication;
[WebMethod]
[SoapHeader("authentication", Required = true)]
public string ValidUser()
{
if (User.IsInRole("Customer"))
return "User is in role customer";
if (User.Identity.IsAuthenticated)
return "User is a valid user";
return "not authenticated";
}
}
}
in my console apps i create the proxy of the above web service just by add web reference. the problem is AuthHeaderValue or UserCredentialsValue both property is not being expose at client side by which i can send user credentials. see my client code
ServiceReference1.SecureWebServiceSoapClient xx = new ServiceReference1.SecureWebServiceSoapClient();
ServiceReference1.Authentication a = new ServiceReference1.Authentication();
a.User = "Hello";
a.Password = "Hello";
xx.AuthHeaderValue or xx.UserCredentialsValue
guide me where i made the mistake. i am working with VS2013 IDE. thanks
tbhattacharjee
|
|
|
|
|
I did something simliar last year, in which I made a web service for a web application, that a vb.net app would access.
So on the Web Side, I made a Class but used Get Set and serialized it. And made a web service as well.
I wrote this in VB off the top of my head, I could not find any examples on how to do it and I wasn't writing C# yet.
<Serializable()>
Public Class ws_subscribersCount_Request
<pre>
Private m_Credentials_Key As String
Private m_Credentials_Password As String
Public Property Credentials_Key As String
Get
Return m_Credentials_Key
End Get
Set(value As String)
m_Credentials_Key = value
End Set
End Property
Public Property Credentials_Password As String
Get
Return m_Credentials_Password
End Get
Set(value As String)
m_Credentials_Password = value
End Set
End Property
End Class
<webmethod(enablesession:=true)> _
Public Function subscribers_count( _
ByVal SubscribersRequest As ws_subscribersCount_Request) As ws_subscribersCount_Response
Dim subscribers As New ws_subscribersCount_Response
Dim dwXCode As Integer = crm_ef_login.administrator_Login(
SubscribersRequest.Credentials_Key,
SubscribersRequest.Credentials_Password
)
If (0 = dwXCode) Then
Dim m_count As Integer = crm_ws_ef_subscribers.subscribers_Count()
If (m_count > 0) Then
subscribers.response_Code = "OK"
subscribers.response_Text = m_count & " subscribers have loaded successfully"
subscribers.count = m_count
Else
subscribers.response_Code = "E001"
subscribers.response_Text = "No subscribers exist in the database"
subscribers.count = 0
End If
Else
subscribers.response_Code = "E000"
subscribers.response_Text = "Failed Authentication"
subscribers.count = 0
End If
Return subscribers
End Function
Then on the client side, I registered a Service Reference by running the web app in debug, and then using VS to register the asmx file,
Add Service Reference
find the asmx file using a browser and copy the address, then paste the address into the client address textbox and add ? WSDL to it
http://localhost:7591/smtpMessenger.asmx?WSDL
This will turn the URL into a WSDL or SOAP class in the console app your testing or writing.
Then in the client app, this is how you handle the call
Public Shared Function get_Subscriber_Count( _
ByRef pResult As crm.ws_subscribersCount_Response) As Integer
Dim txn As New crm.ws_subscribersCount_Request
Dim credentials As New soap_credentials()
soap_credentials_io.soap_configuration_read(credentials)
Dim m_endpointUrl As String = Nothing
Dim m_serviceModel_Binding As System.ServiceModel.HttpBindingBase = Nothing
Select Case credentials.EnableSSL
Case True
m_serviceModel_Binding = New System.ServiceModel.BasicHttpsBinding()
Dim x As Integer = credentials.WebsiteUrl.LastIndexOf("//") + 2
m_endpointUrl = "https://" & credentials.WebsiteUrl.Substring(x, credentials.WebsiteUrl.Length - x)
Case False
m_serviceModel_Binding = New System.ServiceModel.BasicHttpBinding()
Dim x As Integer = credentials.WebsiteUrl.LastIndexOf("//") + 2
m_endpointUrl = "http://" & credentials.WebsiteUrl.Substring(x, credentials.WebsiteUrl.Length - x)
End Select
txn.Credentials_Key = credentials.Secure_UserName
txn.Credentials_Password = credentials.Secure_Password
Dim remoteAddress As New System.ServiceModel.EndpointAddress(m_endpointUrl)
Try
Using client As New crm.ws_smtpMessengerSoapClient(m_serviceModel_Binding, remoteAddress)
Dim responseType As New crm.ws_subscribersCount_Response
responseType = client.subscribers_count(txn)
pResult = responseType
If (pResult Is Nothing) Then
pResult = New crm.ws_subscribersCount_Response
pResult.response_Code = "E100"
pResult.response_Text = ""
End If
End Using
Catch ex As Exception
pResult = New crm.ws_subscribersCount_Response
pResult.response_Code = "ESOAP"
pResult.response_Text = ex.Message.ToString
End Try
End Function
Maybe someone could help and fix the formatting, in the past it worked great, now I struggle with it.
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.
|
|
|
|
|
i asked different question. my problem is AuthHeaderValue or UserCredentialsValue is not getting available in my console apps
where i am consuming web service. i need to pass credentials from client side to service side.
AuthHeaderValue or UserCredentialsValue not being exposed at client side. so anyone guide me. thanks
tbhattacharjee
|
|
|
|
|
In the demo code, there are 2 objects, 1 being the web service and the other being the authentication header
In your sample code, you made the authentication object, but I don't see the web service object to bind the header data to and transmit it.
private void Page_Load(object sender, System.EventArgs e)
{
AuthWebService.WebService webService = new AuthWebService.WebService();
AuthWebService.AuthHeader authentication = new AuthWebService.AuthHeader();
authentication.Username = "test";
authentication.Password = "test";
webService.AuthHeaderValue = authentication;
DataSet dsData = webService.SensitiveData();
response string = webService.SensitiveData();
dgData.DataSource = dsData;
dgData.DataBind();
}
And I have no idea if your web service really works or not.
To test, you really need to run the web service in Debug, and when you call it, walk the code to make sure it works, and look at what is returned by the webservice before it sends the data back. If you can't walk the code, then perhaps your never really calling the web service and nothing is happening.
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.
|
|
|
|
|
i have face the problem at this line
webService.AuthHeaderValue = authentication;
in my case AuthHeaderValue was not exposing at client side but AuthHeaderValue was public in my web service.
if possible give me the code for your web service design and i want to see how you apply soapheader attribute.
thanks a lot for reply.
tbhattacharjee
|
|
|
|
|
Mines just a class written in VB. The class is then registered on a asmx page as a single line.
The web service class uses serialized classes to package the data, and not just a couple of primitive variables.
As far as the namespace goes, never had a problem with it "redcopper.net"
I was thinking about your post last night, and realized the code the article your referencing is for authenticating using the SOAP header, in an existing SOAP operation that actually works. In other words, you have an existing SOAP application that works, but you want to authenticate in the SOAP header, before the server responds to the SOAP envelope or body of data.
You may want to consider getting the SOAP envelope working first, and then add the code to authenticate using the SOAP header.
To get the SOAP envelope working first, remove or remark out the [SoapHeader ("Authentication", Required=true)]
But ...
[SoapHeader ("Authentication", Required=true)]
This part here must activate or tell the WebMethod to analyse or process the SOAP header first, sort of like a MVC controller attribute in which because required = true, it expects the model "AuthHeader" to be present. If it's not present or does not match the format, the SOAP call is rejected.
public AuthHeader Authentication;
public class AuthHeader : SoapHeader
{
public string Username;
public string Password;
}
The class above called AuthHeader is used in the WebMethod, but must be the same exact class referenced in your console app via a WebReference. It can't be a copy of the class in your console app, in other words having 2 of them; one on the client and one on the server, it has to be the same exact class, or else it won't work.
So here is the simple client again ...
AuthWebService.WebService webService = new AuthWebService.WebService();
AuthWebService.AuthHeader authentication = new AuthWebService.AuthHeader();
authentication.Username = "test";
authentication.Password = "test";
webService.AuthHeaderValue = authentication;
DataSet dsData = webService.SensitiveData();
Regardless of how you write the SOAP code, everything on the client side must use the WebServices classes, so you create a WebReference.
In the sample project, there is a WSDL file. This file is created when you make a WebReference on the client.
If you input data into the WebReference Tool, you will then target the service end point of the service,
in this case I changed it to http://localhost:5636/AuthForWebServices/WebService.asmx to point to a debug server.
<binding name="WebServiceHttpGet" type="s0:WebServiceHttpGet">
<http:binding verb="GET" />
</binding>
<binding name="WebServiceHttpPost" type="s0:WebServiceHttpPost">
<http:binding verb="POST" />
</binding>
<service name="WebService">
<port name="WebServiceSoap" binding="s0:WebServiceSoap">
<soap:address location="http://localhost:5636/AuthForWebServices/WebService.asmx" />
</port>
<port name="WebServiceHttpGet" binding="s0:WebServiceHttpGet">
<http:address location="http://localhost:5636/AuthForWebServices/WebService.asmx" />
</port>
<port name="WebServiceHttpPost" binding="s0:WebServiceHttpPost">
<http:address location="http://localhost:5636/AuthForWebServices/WebService.asmx" />
</port>
If you can't contact the WebService, then you may have a binding or service endpoint error; that is determined by the above file.
Check and make sure your WSDL file is correct, and has the correct URL, check the HTTP or HTTPS for port 80 or 443.
The one thing I don't like about this, is that you have to change the URL when you use it in production to match the production servers URL.
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.
|
|
|
|
|
thanks for your answer. thanks for your below code
AuthWebService.WebService webService = new AuthWebService.WebService();
AuthWebService.AuthHeader authentication = new AuthWebService.AuthHeader();
authentication.Username = "test";
authentication.Password = "test";
webService.AuthHeaderValue = authentication;
DataSet dsData = webService.SensitiveData();
i am working with VS2013. i construct my code the same way but in my case i can not pass credentials this way
webService.AuthHeaderValue = authentication;
rather i have to pass auth like this way when calling service function from client side
ServiceReference1.AuthenticateHeader oAuth = new ServiceReference1.AuthenticateHeader();
oAuth.UserName = "Test";
oAuth.Password = "Test";
ServiceReference1.Test1SoapClient oClient =new ServiceReference1.Test1SoapClient();
try
{
var o= oClient.Add(oAuth, 2, 3);
}
catch(SoapException SoapEx)
{
}
catch (Exception Ex)
{
}
tbhattacharjee
|
|
|
|
|
That looks like your spin on the code from the sample app.
You can name the Web Reference whatever you like. And you can rename the Web Reference as Well.
You can also use Fiddler to hook your program in debug and see if the data is attached in the SOAP header. Then you can isolate where your issue really lies.
You capture the request and response, and inspect the data in the right side window.
Fiddler free web debugging proxy[^]
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.
|
|
|
|
|
i have a asmx web service and i attached the Soap Extension just to intercept data and encrypt/decrypt it but the problem is Soap Extension ProcessMessage function not calling
here is my full code with web.config and i am running the code from VS2013.
please see my code and tell me where i made the mistake for which ProcessMessage function not calling
namespace EncryptASMX
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class Test1 : System.Web.Services.WebService
{
public AuthenticateHeader Credentials;
[AuthExtension]
[SoapHeader("Credentials", Required = true)]
[WebMethod]
public string Add(int x, int y)
{
return (x + y).ToString();
}
}
public class AuthenticateHeader : SoapHeader
{
public string UserName;
public string Password;
}
[AttributeUsage(AttributeTargets.Method)]
public class AuthExtensionAttribute : SoapExtensionAttribute
{
int _priority = 1;
public override int Priority
{
get { return _priority; }
set { _priority = value; }
}
public override Type ExtensionType
{
get { return typeof(AuthExtension); }
}
}
public class AuthExtension : SoapExtension
{
public override void ProcessMessage(SoapMessage message)
{
if (message.Stage == SoapMessageStage.AfterDeserialize)
{
foreach (SoapHeader header in message.Headers)
{
if (header is AuthenticateHeader)
{
AuthenticateHeader credentials = (AuthenticateHeader)header;
if (credentials.UserName.ToLower() ==
"jeff" &&
credentials.Password.ToLower() ==
"imbatman")
return;
break;
}
}
throw new SoapException("Unauthorized",
SoapException.ClientFaultCode);
}
}
public override Object GetInitializer(Type type)
{
return GetType();
}
public override Object GetInitializer(LogicalMethodInfo info,
SoapExtensionAttribute attribute)
{
return null;
}
public override void Initialize(Object initializer)
{
}
}
}
web.config entry
="1.0"
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<webServices>
<soapExtensionTypes>
<add type="EncryptASMX.AuthExtension,EncryptASMX" priority="1" />
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>
i consult two links but still not configure how to run process message. here are the links
http://www.c-sharpcorner.com/article/using-soap-header-and-soap-extensions-in-a-web-service/
http://www.codeguru.com/csharp/csharp/cs_webservices/security/article.php/c5479/Build-Secure-Web-Services-With-SOAP-Headers-and-Extensions.htm
tbhattacharjee
|
|
|
|
|
this problem has been solved. process message fire when we call web service from client side. thanks
tbhattacharjee
|
|
|
|
|
i need to create a wesite for alumni association of my collage,please help
i wish to do it in asp .net
|
|
|
|
|
|
Sanju govind wrote: please help What do you need? Why come and post what that you need help but then not tell anyone what you need help with? That's strange.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
before we proceed, There are lot of WH here
- what is the requirement
- what is the background
- what about data analysis
- what is table design
- what could be the volumes
- Do you need to implement access permissions
???
Find More .Net development tips at : .NET Tips
The only reason people get lost in thought is because it's unfamiliar territory.
|
|
|
|
|
I am inserting into the database and want to pass the id to the next page via response.redirect but am not sure how to do that.
Here is the code I have:
string custsrc = custsrccode.Text;
string name = custname.Text;
string city = custcity.Text;
string state = custstate.Text;
string postcode = custpostalcode.Text;
string actcode = activitycode.SelectedItem.Text;
string id = labelID.Text;
string activityid = labelactivityid.Text;
OracleConnection conn = new OracleConnection();
conn.ConnectionString = strConnection;
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "INSERT INTO BUYING_ACTIVITY (CUSTOMER_SOURCE_CODE, CUSTOMER_NAME, CUSTOMER_CITY, CUSTOMER_STATE, CUSTOMER_POSTAL_CODE, BUYING_ACTIVITY_CODE, ID) " +
"VALUES (:custsrc, :name, :city, :state, :postcode, :actcode, :id)";
cmd.Parameters.Add(new OracleParameter("custsrc", custsrc));
cmd.Parameters.Add(new OracleParameter("name", name));
cmd.Parameters.Add(new OracleParameter("city", city));
cmd.Parameters.Add(new OracleParameter("state", state));
cmd.Parameters.Add(new OracleParameter("postcode", postcode));
cmd.Parameters.Add(new OracleParameter("actcode", actcode));
cmd.Parameters.Add(new OracleParameter("id", id));
cmd.ExecuteNonQuery();
conn.Close();
Response.Redirect("contractinfo.aspx?Id=" + labelRID.Text);
I get nothing on the labelID.Text when I step thru my code and then when it goes to the next page I obviously get nothing as well contractinfo.aspx?Id="" where the "" should be the id value. How do I fix this with the code I have.
|
|
|
|
|
You read the id from labelID
string id = labelID.Text;
But the ID you are passing on the query string is labelRID
Response.Redirect("contractinfo.aspx?Id=" + labelRID.Text);
If it's the same id use the same label, or just re-use the id variable
Response.Redirect("contractinfo.aspx?Id=" + id);
|
|
|
|
|
I have these fields set to the asp controls below:
string contnumber = contractnumber.Text;
string solnumber = solicitationnumber.Text;
string ordnumber = ordernumber.Text;
string contstartdate = contractstartdate.Value;
string contenddate = contractenddate.Value;
string solstartdate = solicitationstartdate.Value;
string solenddate = solicitationenddate.Value;
string soltype = solicitationtype.Text;
string pasnum = pasnumber.Text;
string commnts = comments.Text;
string contkind = contractkind.SelectedItem.Text;
string conttype = contracttype.SelectedItem.Text;
string ponum = ponumber.Text;
string instrtype = instrumenttype.SelectedItem.Text;
string totcontractamount = totalcontractamount.Text;
string estimloddate = estloddate.Value;
string contfirstname = contractfirstname.Text;
string contmiddleinit = contractmiddleinit.Text;
string contlastname = contractlastname.Text;
string lodsigned = datelodsigned.Value;
string contractid = contractinfoid.Text;
when I open the form to update some of these fields the fields don't update when I step thru the code and obviously don't update using this update statement to the database:
OracleConnection conn = new OracleConnection();
conn.ConnectionString = strConnection;
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "UPDATE CONTRACT_INFO SET CONTRACT_SELECTION = :contractselection, CONTRACT_NUMBER = :contnumber, SOLICITATION_NUMBER = :solnumber, ORDER_SELECTION = :orderselection, ORDER_NUMBER = :ordnumber, CONTRACT_START_PERIOD = to_date(:contstartdate, 'MM/DD/YYYY'), CONTRACT_END_PERIOD = to_date(:contenddate, 'MM/DD/YYYY'), SOLICITATION_START_DATE = to_date(:solstartdate, 'MM/DD/YYYY'), SOLICITATION_END_DATE = to_date(:solenddate, 'MM/DD/YYYY'), SOLICITATION_TYPE = :soltype, SURVEY_REQUESTED = :preaward, PAS_NUMBER = :pasnum, COMMENTS = :commnts, CONTRACT_KIND = :contkind, CONTRACT_TYPE = :conttype, PO_ASSOCIATED = :poselection, PO_NUMBER = :ponum, INSTRUMENT_TYPE = :instrtype, TOTAL_CONTRACT_AMOUNT = :totcontractamount, EST_LOD_COMPLETION_DATE = to_date(:estimloddate, 'MM/DD/YYYY'), FIRST_NAME = :contfirstname, MIDDLE_INIT = :contmiddleinit, LAST_NAME = :contractlastname, DATE_LOD_SIGNED = to_date(:lodsigned, 'MM/DD/YYYY') CONTRACT_INFO_ID = :contractid";
cmd.Parameters.Add(new OracleParameter("contractid", contractid));
cmd.Parameters.Add(new OracleParameter("contractselection", contselection));
cmd.Parameters.Add(new OracleParameter("contnumber", contnumber));
cmd.Parameters.Add(new OracleParameter("solnumber", solnumber));
cmd.Parameters.Add(new OracleParameter("orderselection", ordselection));
cmd.Parameters.Add(new OracleParameter("ordnumber", ordnumber));
cmd.Parameters.Add(new OracleParameter("contstartdate", contstartdate));
cmd.Parameters.Add(new OracleParameter("contenddate", contenddate));
cmd.Parameters.Add(new OracleParameter("solstartdate", solstartdate));
cmd.Parameters.Add(new OracleParameter("solenddate", solenddate));
cmd.Parameters.Add(new OracleParameter("soltype", soltype));
cmd.Parameters.Add(new OracleParameter("preaward", preawardselection));
cmd.Parameters.Add(new OracleParameter("pasnum", pasnum));
cmd.Parameters.Add(new OracleParameter("commnts", commnts));
cmd.Parameters.Add(new OracleParameter("contkind", contkind));
cmd.Parameters.Add(new OracleParameter("conttype", conttype));
cmd.Parameters.Add(new OracleParameter("poselection", purselection));
cmd.Parameters.Add(new OracleParameter("ponum", ponum));
cmd.Parameters.Add(new OracleParameter("instrtype", instrtype));
cmd.Parameters.Add(new OracleParameter("totcontractamount", totcontractamount));
cmd.Parameters.Add(new OracleParameter("estimloddate", estimloddate));
cmd.Parameters.Add(new OracleParameter("contfirstname", contfirstname));
cmd.Parameters.Add(new OracleParameter("contmiddleinit", contmiddleinit));
cmd.Parameters.Add(new OracleParameter("contlastname", contlastname));
cmd.Parameters.Add(new OracleParameter("lodsigned", lodsigned));
cmd.ExecuteNonQuery();
conn.Close();
This is used on a button click event. What am I doing wrong. Is there something I need to do when in addition to setting these fields so that they update when I change them on the form and in the database.
|
|
|
|
|
Did you mean to say "fields", or did you mean "local variables"?
Fields (C# Programming Guide)[^]
Variables and Constants[^]
If you're using fields, you're doing it wrong.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I mean I'm setting the variables : string contnumber equal to the asp form control text box: contractnumber.Text. And then I set those variables equal to the database fields in the update statement to update the database. When I make changes to fields on this form (textboxes, dropdowns,etc.) and click Submit button the fields don't get updated to the database. That's the problem that I need help with.
|
|
|
|
|
Debug the code and watch what is happening. You'll solve it in no time.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have a dropdown(code is name of the dropdown) that when coming from another page it prefills with a value, the required validator fires off. I have a select statement that fills in all textboxes and dropdowns on this page. When I open this page by itself the validation functions as normal meaning when I select a value from the dropdown no validation and when it is blank it validates. Here is the code for the select statement and reading in the data on page load:
OracleConnection conn = new OracleConnection();
OracleCommand cmd = new OracleCommand();
conn.ConnectionString = strConnection;
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "Select RID, CODE, CUSTOMER_NAME from ACTIVITY WHERE ID = :IDValue";
cmd.Parameters.Add(new OracleParameter("IDValue", Request.QueryString["ID"]));
OracleDataAdapter da = new OracleDataAdapter(cmd);
cmd.CommandType = CommandType.Text;
OracleDataReader dr = cmd.ExecuteReader();
name.Text = dr["customer_name"].ToString();
code.SelectedItem.Text = dr["code"].ToString();
dr.Close();
conn.Close();
I know this has Oracle code in it but it is more of a C#/ASP.net question.
|
|
|
|
|
Bootzilla33 wrote: code.SelectedItem.Text = dr["code"].ToString();
Why are you changing the text of the selected item, rather than selecting the item?
Try:
code.SelectedValue = dr["code"].ToString();
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm not changing the text?? I'm calling that value for that dropdown from the database by using the Select statement.
|
|
|
|
|