これは ToString() ではなく Session の問題かもしれませんが、よくわかりません。
2 つの .aspx ページがあり、あるページから別のページにデータテーブルから IP アドレスを渡したいと考えています。これを行うと、不要なスペースが追加されます。コードの単純なバージョンは次のとおりです。
最初の .aspx ページ
int num = DropDownList1.SelectedIndex;
DataView tempDV = SqlDataSource2.Select(DataSourceSelectArguments.Empty) as DataView;
Session["camera"] = tempDV.Table.Rows[num].ItemArray[2];
Response.Redirect("test.aspx");
test.aspx ページ
string ipCamAdd = Session["camera"].ToString();
TextBox1.Text = "http://" + ipCamAdd + "/jpg/image.jpg?resolution=320x240";
私が印刷したいのは
http ://ipadd/jpg/image.jpg?resolution=320x240
しかし、出力されるのは
http//ipaddress /jpg/image.jpg?resolution=320x240
どうすればこれを修正できますか?
また、なぜこれが起こっているのか誰かが教えてくれることを期待して、この質問をしました。間違いをお詫び申し上げます。